PDFs

Skip to end of metadata
Go to start of metadata

By default, the AppDynamics Java Agent writes log files to the <agent_home>/logs/<node_name> directory. See Agent Log Files for information about how the logs are organized into sets that roll over.

About Log File Sizes

On each JVM restart, the agent creates a new set of log files, named according to the JVM restart time. Logs for the most recent 5 restarts are retained. Within a set of agent logs, each log type can have multiple log files. The agent retains the logs generated at startup as a troubleshooting aid, and then retains the most recent 4 logs on a rolling basis.  Each log file for a specific log can grow to 5 MB. The four subsequent log files for the log can each grow to 5 MB.

Modifying the Log Directory Location

To specify a different log directory, use the following system property: 

-Dappdynamics.agent.logs.dir 

Set the Agent Log Level

The default logging level for most log files is INFO. Higher logging levels consume more disk space. You can control the logging level for the Java Agent by changing the value of the "level value" parameter in the log4j.xml file in the versioned logging configuration file directory: <agent_home>/<version_number>/conf/logging. For example, to set the log level to DEBUG:

<logger name="com.singularity" additivity="false">
 <!--  to control the logging level of the agent log files, use the level attribute below. value="all|trace|debug|info|warn|error"-->
<level value="debug"/>
<appender-ref ref="AgentLogger"/>
<appender-ref ref="RESTLogger"/>
</logger>

Log to Syslog

Instead of having the Java Agent write to the default log directory in the agent home directory, you can configure the agent to direct logging output to syslog. The agent supports syslog-based logging through log4j SyslogAppender.  

To configure the agent to send logs to syslog: 
  1. Open the following configuration file in the agent home for editing:
    <agent_home>/ver<version_number>/conf/logging/log4j.xml

  2. Add the following section to the configuration file:

    <appender name="SyslogAppender" class="com.singularity.util.org.apache.log4j.net.SyslogAppender">
        <param name="Facility" value="local6"/>
        <param name="FacilityPrinting" value="true"/>
        <param name="SysLogHost" value="localhost"/>
        <layout class="com.singularity.util.org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="[%t] %d{DATE} %5p %c - %m%n"/>
        </layout>
    </appender>
  3. Configure the agent to redirect its logs to this appender. Find and replace this section of the file: 

    <logger name="com.singularity" additivity="false">
         <!--  to control the logging level of the agent log files, use the level attribute below. value="all|trace|debug|info|warn|error"-->
         <level value="info"/>
         <appender-ref ref="AgentLogger"/>
         <appender-ref ref="RESTLogger"/> 
    </logger>

    With the following:

    <logger name="com.singularity" additivity="false">
         <!--  to control the logging level of the agent log files, use the level attribute below. value="all|trace|debug|info|warn|error"-->
         <level value="info"/>
         <appender-ref ref="SyslogAppender"/>
         <appender-ref ref="RESTLogger"/>
    </logger>
  4. Save the file and restart the JVM.  
  • No labels