Configure Logging

APM Connect uses log4j version 1.2 to log events and provides a default configuration for logging events. These steps describe how to modify this default configuration.

Steps

  1. On the APM Connect Server, navigate to the folder C:\APMConnect\Config.
  2. Open the file log4j.properties in an application that you can use to modify a text file (e.g., Notepad).
  3. Modify the log4j.rootLogger statement to select the correct severity level and appender. Consider the following example of a modified statement:

    log4j.rootLogger=ERROR, fileout

    ...where the first value is the severity level and the second value is the appender to use. You can enter any of the following values as the severity level:

    The severity level that you configure controls the messages written to the log. Each severity causes the system to filter messages above that type in the preceding list.

    Note: The appender value must be either fileout or consoleout.

    IMPORTANT: To collect the most complete information, do not change the conversion pattern on any appender you use.

  4. Modify the log4j.logger.org.apache.cd statement to log the Web Service request and response messages. The format is similar to log4j.rootlogger.
  5. Modify the log4j.logger.org.apache.activemq statement to enable the logging levels for ActiveMQ messages. The format is similar to log4j.rootlogger.
  6. If you use the console appender, uncomment all statements containing consoleout and comment the statements containing fileout. Consider the following example:

    # consoleout is set to be a ConsoleAppender.
    log4j.appender.consoleout=org.apache.log4j.ConsoleAppender
    log4j.appender.consoleout.Threshold=DEBUG
    log4j.appender.consoleout.layout=org.apache.log4j.PatternLayout
    log4j.appender.consoleout.layout.ConversionPattern=[%-5p][%d{dd MMM yyyy HH:mm:ss}][%t][%c][%M] %x - %m%n
    #fileout uses fileAppender
    #log4j.appender.fileout=org.apache.log4j.RollingFileAppender
    #log4j.appender.fileout.Threshold=debug
    #log4j.appender.fileout.MaxFileSize=1MB
    #log4j.appender.fileout.MaxBackupIndex=2
    #log4j.appender.fileout.File=${LOG}/${LOG_FILE}
    #log4j.appender.fileout.Append=true
    #log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
    #log4j.appender.fileout.layout.ConversionPattern=[%-5p][%d{dd MMM yyyy HH:mm:ss}][%t][%c][%M] %x - %m%n

    Note: When configuring logging for SAP or SAP PI, you must specify the actual path to the log file as the value of log4j.appender.fileout.file.

  7. If you use the file rolling appender:

    1. Modify the log4j.appender.fileout.MaxFileSize value to the appropriate size for your installation.
    2. Modify the log4j.appender.fileout.MaxBackupIndex value to the number of log files you want to keep.
  8. Save the file.

    Event logging has been configured.

Copyright © 2018 General Electric Company. All rights reserved.