Cleaning up log files

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

The cleanup of Forefront Unified Access Gateway (UAG) log files prevents a buildup of old log files that can, in time, fill up the available disk space on the Forefront UAG server. By default, Forefront UAG log files include event logs, error logs, trace logs, and Internet Information Services (IIS) log files.

The following procedures describe:

  • How the log file cleanup process works—Provides an overview of the cleanup process.

  • Configuring log file cleanup parameters─You can configure cleanup parameters, including the minimum and maximum amount of disk space allocated to the log files, and the number of files you want to retain.

  • Excluding IIS files from cleanup─You can exclude IIS files if you do not want the IIS logs to be calculated in the computation of the space allocated for log files, and you do not want IIS log files to be deleted during the log file cleanup process.

How the log file cleanup process works

The log file cleanup process starts only when one of the following occurs:

  • The number of log files, including Forefront UAG event, error, trace log files, and IIS log files, exceeds 2,048. This parameter is hard-coded and cannot be changed.

  • The total size of all the event, error, trace log files, and IIS log files, exceeds the Start Cleanup at value.

Log cleanup is not started if there is a disk overview. In this case, error and trace logs are no longer written to the disk, without notification. It is therefore important to configure the Start Cleanup at property, according to the disk capacity.

After the log file cleanup starts, the process is as follows:

  1. Log files are deleted, starting with the oldest files, according to the file modification time (not according to the file’s timestamp).

  2. Files are deleted until the total size of the files left on the disk reaches the value defined in Stop Cleanup at. For each type of file, the cleanup process leaves a number of files undeleted, as determined by the value defined in Number of Undeleted Files.

    Log cleanup completes as follows:

    • If, after deleting files, the total size of the log file matches (or is less than) the value specified in Stop Cleanup at, then the log file cleanup is complete.

    • If, after deleting files, the total size of the log file matches the value defined in Number of Undeleted Files but the size still exceeds Stop Cleanup at, then the Number of Undeleted Files value is ignored, and deletion continues (starting with the oldest file). Deletion continues until the total size of the log file reaches the value specified in Stop Cleanup at.

The following diagram describes the flow of the log file cleanup mechanism.

Log File Cleanup Mechanism

Ee406237.d3ffe3ae-31ea-47c3-97c9-72d6c5befa01(en-us,TechNet.10).gif

Configuring log file cleanup parameters

To configure log file cleanup parameters

  1. In the Forefront UAG Management console, click Advanced Configuration on the Admin menu.

  2. In Log File Cleanup, change one or more of the following options:

    • Start Cleanup at—Specifies the total size (in megabytes) of Forefront UAG and IIS log files that can be kept on the disk, before Forefront UAG starts the log file cleanup process.

    • Stop Cleanup at—Specifies the total size (in megabytes) of Forefront UAG, and IIS log files that are kept on the disk after the log file cleanup process.

    • Number of Undeleted Files—Specifies the maximum number of files retained after the log cleanup process. It includes event, trace, IIS log files (the number of files retained for each individual trace), and error log files (the number of files retained in twice the specified value).

Note

The ratio between undeleted error log files and other log files is hardcoded and cannot be changed.

Excluding IIS log files from cleanup

By default, the cleanup includes the IIS log files on the Forefront UAG server.

To exclude the IIS log files from the cleanup process

  1. On the Forefront UAG server, click Start, and type RegEdit to open the Registry Editor.

  2. Access the following registry key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\whlerrsrv\Parameters\. If the registry key does not exist, you must create it.

  3. Create a new DWORD value: NoIISLogClean.

  4. Change the Value data of NoIISLogClean to 1.

    • Restart the UAG Log Server service.

    The Restart Other Services dialog box is displayed.

    Tip

    When you stop the UAG Log Server service, a number of other dependent services are also stopped. When you use the Restart command, the UAG Log Server service is automatically stopped and restarted, as are all the dependent services. For this reason, it is recommended that you use the Restart command and not the Stop command. If you do stop the service with the Stop command, make sure that you manually start the UAG Log Server service, and all the dependent services that were stopped.

  5. Click Yes to restart all listed services.

    The UAG Log Server service and all other services in the list are stopped, and are then restarted automatically.

    IIS log files will not be computed in the calculation of space defined in the trace.ini configuration file, and will not be deleted by the log file cleanup process on the Forefront UAG server.

Copyright © 2009 by Microsoft Corporation. All rights reserved.