How to Manage Agent Log Output

Microsoft Exchange Server 2007 will reach end of support on April 11, 2017. To stay supported, you will need to upgrade. For more information, see Resources to help you upgrade your Office 2007 servers and clients.

 

Applies to: Exchange Server 2007, Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3

This topic explains how to configure the EdgeTransport.exe.config file to manage the anti-spam agent log files. By default, Microsoft Exchange Server 2007 logs all anti-spam agent activity in the %programfiles%\Microsoft\Exchange Server\TransportRoles\Logs\AgentLog directory. To filter the anti-spam agent logs, use the Get-AgentLog cmdlet. For more information, see Get-AgentLog.

The default configuration of the agent log files are as follows:

  • Maximum size of the agent log directory: 250 MB

  • Maximum size of a single agent log file: 10 MB

  • Maximum age of log files: 30 days

Important

Exchange 2007 Service Pack 1 (SP1) includes keys in the EdgeTransport.exe.config application configuration file that let you modify these default values. The release to manufacturing (RTM) version of Exchange 2007 does not read the keys that are documented in this topic.

Modifying the EdgeTransport.exe.config File

All modifications of configuration options for managing agent log output must be made in the EdgeTransport.exe.config file that is located in the %programfiles%\Microsoft\Exchange Server\Bin directory. The EdgeTransport.exe.config file is an XML application configuration file that is associated with the EdgeTransport.exe file. EdgeTransport.exe and MSExchangeTransport.exe are the executable files that are used by the Microsoft Exchange Transport service. This service runs on every Hub Transport server and Edge Transport server. Changes that are saved to the EdgeTransport.exe.config file are applied after the Microsoft Exchange Transport service is restarted. The default value is enforced if either of the following conditions is true:

  • A configuration option is missing.

  • A configuration option is present and contains the default value.

The following example shows the typical structure of the EdgeTransport.exe.config file:

<configuration> 
<runtime> 
<gcServer enabled="true" /> 
</runtime> 
<appSettings> 
<add key=" Configuration Option " value=" Value " /> 

</appSettings> 
</configuration> 

You can add new configuration options or modify existing configuration options in the <appSettings> section. Many of the available configuration options are not related to agent log output. Configuration options that are not related agent log output are outside the scope of this topic.

Agent Log Output Keys

Agent log output is managed by the following keys in the EdgeTransport.exe.config file:

<add key="AgentLogEnabled" value="system.boolean" />
<add key="AgentLogMaxDirectorySize" value="system.int32" />
<add key="AgentLogMaxFileSize" value="system.int32" />
<add key="AgentLogMaxAge" value="system.timespan" />

By default, only the AgentLogEnabled key is present in the EdgeTransport.exe.config file. You must add all other keys. The following table explains each key in more detail.

Key Value type Description

AgentLogEnabled

System.Boolean

By default, this key exists in EdgeTransport.exe.config. Valid values for this key are true or false. The default value is true.

AgentLogMaxDirectorySize

System.Int32

By default, this key does not exist in EdgeTransport.exe.config. The value of this key specifies the maximum size, in bytes, of the AgentLog directory. When this value is exceeded, the oldest log file in the directory is deleted and a new log file is created.

If this key is not specified, the default value is 250 MB, or 262144000 bytes (250*1024*1024) in Exchange 2007 RTM and Exchange 2007 SP1.

AgentLogMaxFileSize

System.Int32

By default, this key does not exist in EdgeTransport.exe.config. The value of this key specifies the maximum size, in bytes, of each log file in the directory. When a log file reaches the size specified, a new log file is created.

If this key is not specified, the default is 10 MB, or 10485760 bytes (10*1024*1024) in Exchange 2007 RTM and Exchange 2007 SP1.

AgentLogMaxAge

System.TimeSpan

By default, this key does not exist in EdgeTransport.exe.config. The value of this key specifies the maximum age limit of a given log file. When a log file exceeds the age limit, it is deleted.

This key is of system type TimeSpan. The value of this key can be represented as a string in the format d.hh:mm:ss.ff where d is days, hh is hours, mm is minutes, ss is seconds, and ff is fractions of a second.

If this key is not specified, the default value is 30 days, or 30.00:00:00.00 in Exchange 2007 RTM and Exchange 2007 SP1.

Before You Begin

To perform this procedure, the account you use must be delegated the following:

  • Member of the local Administrators group on the computer

For more information about permissions, delegating roles, and the rights that are required to administer Exchange 2007, see Permission Considerations.

Procedure

To add and configure the agent log output keys in the EdgeTransport.exe.config file

  1. On the Hub Transport server or Edge Transport server on which you want to manage the agent log output, open the EdgeTransport.exe.config in an ASCII text editor such as Notepad. The EdgeTransport.exe.config file is located in the %programfiles%\Microsoft\Exchange Server\Bin directory.

  2. Locate the AgentLogEnabled key. By default, the keys are listed in alphabetical order under <appsettings>.

  3. Copy and paste the following keys under the AgentLogEnabled key:

    <add key="AgentLogMaxDirectorySize" value="system.int32" />
    <add key="AgentLogMaxFileSize" value="system.int32" />
    <add key="AgentLogMaxAge" value="system.timespan" />
    
  4. Verify that the AgentLogEnabled key is set to true, and add values for the other keys.

  5. When you have finished updating the EdgeTransport.exe.config file, save the file and close it.

  6. You must restart the Microsoft Exchange Transport service before the configuration changes will take effect.

For More Information

For more information, see Get-AgentLog.