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.

Syslog にログを送信するエージェントの構成

  1. エージェントホームにある次の構成ファイルを開いて編集。
    <agent_home>/ver<version_number>/conf/logging/log4j2.xml
  2. 次のセクションを構成ファイルに追加。
    <Syslog name="SyslogAppender" facility="LOCAL1" host="localhost" port="514" protocol="TCP">
    <PatternLayout pattern="[%t] %d{DATE} %5p %c - %m%n"/>
    </Syslog>
  3. 下記のアペンダーにログをリダイレクトするようエージェントを構成。
    ファイルの次のセクションを探して置き換えます。
    <!-- 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> 
    以下と置換
    <!-- 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>