Using Syslog for BAO Logging

Version 1
    Share:|

    Most UNIX -- and some Windows -- environments have Syslogd servers set up to amalgamate logs from multiple sources. This can make life much easier when trying to sift through large numbers of logs, identify patterns, and relate messages across servers.

     

    Atrium Orchestrator writes the bulk of its logging information into the file grid.log, stored locally on each peer. Sometimes this can make debugging difficult, since a workflow can run on any peer and adapters may be enabled across multiple peers.

     

    So why not use Syslog to store AO's logging information?

     

    Well, first let's get the disclaimer out of the way:

     

    This configuration is NOT supported or recommended by BMC Software at this time, and you implement it at your own risk. When dealing with BMC Support, you may be required to undo these changes before a support case can be progressed.


    For the moment, I recommend that if you choose to implement this, you do so only in a non-critical development environment.

     

    There are some other notable downsides:

    • Log messages are sent across the network in plaintext format.
    • At high debug levels, AO can generate a lot of log content, and hence a lot of network traffic.

     

    If you are happy with all of the above caveats, the changes are relatively simple. Make a backup copy of the standard log4j.xml file so that you can restore it when needed.

     

    Your Syslog server is assumed to be running, and listening for external connections on port 514 (UDP).

     

    The file to be amended is <AO_HOME>\tomcat\webapps\baocdp\WEB-INF\classes\log4j.xml.

     

    First, we add a new appender in the top section of the file:

     

        <appender class="org.apache.log4j.net.SyslogAppender" name="Syslog">
            <param name="SyslogHost" value="172.16.182.1:514" />
            <param name="Facility" value="LOCAL6" />
            <param name="FacilityPrinting" value="true" />
            <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%-5p %-15c{1} : %m%n" />
            </layout>
        </appender>
    

     

    Change the SyslogHost value to point to your syslog server. Note the use of the LOCAL6 facility; this will allow you to filter off BAO messages into a dedicated logfile. The exact method will vary by Syslog server. For example, with rsyslogd I can filter LOCAL6.* into /var/log/orchestrator.log. A list of available facilities is in the Log4J SyslogAppender documentation.

     

    Now you simply need to add an appender-ref element to each logger that you want to send to the syslog server. For example, to just record health component messages to syslog:

     

        <logger additivity="false" name="com.realops.foundation.health.HealthComponent">
            <level value="info"/>
            <appender-ref ref="RollingFile"/>
            <appender-ref ref="Syslog"/>
        </logger>
    

     

    Restart the peer once your config changes are complete. This must be repeated on each peer from which you wish to send logs.