GitHubContribute in GitHub: Edit online

How to Set Up Logging for the Syslog

The purpose of this article is to describe how to enhance the configuration of the logging framework used by IBM Manta Data Lineage (Log4j) to log in to the Syslog.

Instructions

Each Manta Data Lineage component has its own logging configuration. If it is desirable for all of them to log in to Syslog, all the following configurations have to be adjusted.

In order to adjust a configuration:

  1. Open the configuration file.

  2. Add a new appender to the Appenders tag. The appender should be defined by pair tags (opening and closing) as shown in the following steps. Nested tags will be provided. Below are some examples of appenders for BSD and RFC5424 standards. For more detailed documentation on appenders, please refer to https://logging.apache.org/log4j/2.x/manual/appenders.html#SyslogAppender.

    1. Example of a BDS appender:

      <Syslog name="syslogAppender" host="localhost" port="1670" protocol="TCP">
        <!-- The nested tags will be defined in step #4 of the tutorial -->
      </Syslog>
      
    2. Example of a RFC5424 appender:

      <Syslog name="syslogAppender" format="RFC5424" host="localhost" port="1670"
                  protocol="TCP" appName="MANTA" includeMDC="true"
                  facility="LOCAL0" enterpriseNumber="18060" newLine="true"
                  messageId="Audit" id="App">
        <!-- The nested tags will be defined in step #4 of the tutorial -->            
      </Syslog>
      
  3. Set the values of the host and port attributes (and other advanced attributes, if used) based on your environment.

  4. Copy the PatternLayout tag from one of the predefined appenders and put it inside your new syslogAppender tag (between the opening and closing tags). Here is an example of a PatternLayout definition. (This example is from a specific version of Manta Data Lineage. The definition may be different in newer versions of Manta Data Lineage.)

    <PatternLayout>
        <MarkerPatternSelector defaultPattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} %equals{%X{context-set}}{true}{[Context: %X{CONTEXT}] }%msg%n">
            <PatternMatch key="ERROR" pattern="%n%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} %equals{%X{context-set}}{true}{[Context: %X{CONTEXT}]}%n%X{CATEGORY} %X{ERROR_TYPE}%nUser message: %X{USER_MESSAGE}%nTechnical message: %X{TECHNICAL_MESSAGE}%nSolution: %X{SOLUTION}%nImpact: %X{IMPACT}%n%n"/>
            <PatternMatch key="PROGRESS" pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] Current progress for connection %X{CONNECTION_ID}: %X{PROGRESS_PERCENTAGE}%enc{%}. Finished %X{CURRENT_PROGRESS} objects out of %X{TOTAL_PROGRESS}.%n"/>
        </MarkerPatternSelector>
    </PatternLayout>
    
  5. Add the syslogAppender reference to all the logger tags that are defined in the Loggers tag.

After the configuration is finalized, Manta Flow Server and Manta Admin UI have to be restarted for the changes to take effect.