This page provides an overview of logging for the .NET Agent on Windows. The .NET Agent hosts log files in the %ProgramData%\AppDynamics\DotNetAgent\Logs directory. To learn how logs are organized into sets that rollover, see Agent Log Files.

Log File Size

Within a set, the first file for the agent log can reach 5 MB. This file never gets deleted because it contains valuable information about the context in which the agent was started.

Each of the remaining logs in the set can reach a maximum of 5 MB.

To allow for several restarts and all possible logs that could be generated (.NET Agent, Business Transaction, and REST), the maximum number of rollover logs is five. The maximum size per set is 5 MB + (5 X 5M B) = 30 MB. 

Some log files, such as SamplingInfo and Winston are configured differently and can be 9 MB in size with only two archive files.

Profiler logging is different; a logging framework called Boost logs to the Profiler folder and creates one file per instrumented process. While Boost uses the archive files and max size, it has two other limits: one to limit the number of files in the Profiler folder (defaults to 50) and the other to limit the max size (defaults to 30 MB).

Control the .NET Agent Log Files

When you upgrade the .NET Agent to versions >= 22.6.0, ensure that the version of the configuration contains the property, concurrentWrites="true"

You can control the .Net Agent log files by changing the <target> settings in the AppDynamicsAgentLog.config file found in the .NET Agent installation directory.

<targets async="true">
    <target name="logfile" xsi:type="File" concurrentWrites="true" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="AgentLog.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}"/>
    <target name="RESTHeartbeat" xsi:type="File" concurrentWrites="true" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="RESTHeartbeat.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}"/>
    <target name="RESTfile" xsi:type="File" concurrentWrites="true" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="RESTCommunications.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}"/>
    <target name="warnfile" xsi:type="File" concurrentWrites="true" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="WarnLog.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}"/>
    <target name="bcifile" xsi:type="File" concurrentWrites="true" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="ByteCode.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}"/>
    <target name="btlog" xsi:type="File" concurrentWrites="true" archiveAboveSize="5000000" maxArchiveFiles="5" createDirs="true" fileName="BusinessTransactionsLog.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}"/>
    <target name="CoordinatorRecovery" xsi:type="File" concurrentWrites="true" archiveAboveSize="2000000" maxArchiveFiles="2" createDirs="true" fileName="CoordinatorRecoveryLog.txt" layout="${longdate} ${processid} ${processname} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}"/>
    <target name="Winston" xsi:type="File" concurrentWrites="true" archiveAboveSize="9000000" maxArchiveFiles="2" createDirs="true" fileName="Winston.txt" layout="${longdate} ${processid} ${appdomainid} ${threadid} ${message}"/>
    <target name="SamplingInfo" xsi:type="File" concurrentWrites="true" archiveAboveSize="9000000" maxArchiveFiles="2" createDirs="true" fileName="SamplingInfo.txt" layout="${longdate} ${processid} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}" />
    <target name="Analytics" xsi:type="File" concurrentWrites="true" archiveAboveSize="9000000" maxArchiveFiles="2" createDirs="true" fileName="Analytics.txt" layout="${longdate} ${processid} ${appdomainid} ${threadid} ${message}" />
    <target name="Profiler" xsi:type="File" concurrentWrites="true" archiveAboveSize="12000000" maxArchiveFiles="2" createDirs="true" fileName="Profiler" layout="${longdate} ${processid} ${appdomainid} ${threadid} ${level} ${logger:shortName=True} ${message}" />
  </targets>

CODE

Control the .NET Agent Loggers

You control the logging level for the .NET Agent by changing the value of the minlevel parameter in the AppDynamicsAgentLog.config file found in the .NET Agent installation directory.

The log configuration is per server. The .NET Machine Agent and the .NET Agent read the same configuration file and write to the same set of output files.

<logger name="com.appdynamics.REST.HeartBeatLog" minlevel="Info" writeTo="RESTHearbeat" final="true" />
    <logger name="*" minlevel="Warn" writeTo="warnfile" />
    <logger name="com.appdynamics.BusinessTransactions" minlevel="Info" writeTo="btlog" final="true" />
    <logger name="com.appdynamics.bci.*" minlevel="Info" writeTo="bcifile" final="true" />
    <logger name="com.appdynamics.REST.*" minlevel="Info" writeTo="RESTfile" final="true" />
    <logger name="AppDynamics.Agent.Coordinator.Recovery.*" minlevel="Info" writeTo="CoordinatorRecovery" final="true" />
    <logger name="com.appdynamics.METRICS.MetricSender" minlevel="Info" writeTo="RESTfile" final="true" />
    <logger name="AppDynamics.Winston.*" minlevel="Info" writeTo="Winston" final="true" />
    <logger name="com.appdynamics.tm.AFastBackendResolver" minlevel="Warn" writeTo="logfile" final="true" />
    <logger name="com.appdynamics.ManagedAgentAPI.DumpStats" minlevel="Trace" writeTo="SamplingInfo" final="true" />
    <logger name="com.appdynamics.ee.service.analytics.Analytics" minlevel="Info" writeTo="Analytics" final="true" />
    <logger name="com.appdynamics.profiler.*" minlevel="Info" writeTo="Profiler" />
    <logger name="*" minlevel="Info" writeTo="logfile" />
CODE