Direct Logging 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.

Configure the Agent to Send Logs to syslog

  1. Open this configuration file in the agent home to edit:
    <agent_home>/ver<version_number>/conf/logging/log4j2.xml
  2. Add this section to the configuration file:
    <Syslog name="SyslogAppender" facility="LOCAL1" host="localhost" port="514" protocol="TCP">
    <PatternLayout pattern="[%t] %d{DATE} %5p %c - %m%n"/>
    </Syslog>
  3. Configure the agent to redirect its logs to this appender.
    Find and replace this section of the file:
    <!-- to control the logging level of the agent log files, use the level attribute below. value="all|trace|debug|info|warn|error"-->
    <AsyncLogger name="com.singularity" level="info" additivity="false">
    <AppenderRef ref="Default"/>
    <AppenderRef ref="RESTAppender"/>
    </AsyncLogger> 
    With the following:
    <!-- to control the logging level of the agent log files, use the level attribute below. value="all|trace|debug|info|warn|error"-->
    <AsyncLogger name="com.singularity" level="info" additivity="false">
    <AppenderRef ref="SyslogAppender"/>
    <AppenderRef ref="RESTAppender"/>
    </AsyncLogger>