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:
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:
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:
Open the following configuration file in the agent home for editing:
Add the following section to the configuration file:
Configure the agent to redirect its logs to this appender. Find and replace this section of the file:
With the following:
- Save the file and restart the JVM.