Setting log4j Configuration Properties

To enable execution tracing, the following log4j configuration properties are required:

  • log4j.logger.com.workbrain2.compliance.svc.ComplianceValidationService= DEBUG, compliance

    To configure compliance logging for diagnostics, it is recommended that you create a configuration with a granularity as specific as com.workbrain2.compliance.svc.ComplianceValidationService. This will provide the most consistent and readable logging output.

    Compliance diagnostics are logged at the DEBUG level, so you must configure the compliance logging level at DEBUG (or lower). For example, if it is configured at ERROR only, none of the diagnostic information will be written to the log file/output. But if it is configured at ALL, everything (including the diagnostic information) will be written to the log file/output.

  • log4j.additivity.com.workbrain2.compliance.svc.ComplianceValidationService=false

    Prevents the DEBUG trace output from adding/propagating to the console and other log files. If this behavior is desired (you need to show the same trace output to console and parent log files), you can set the additivity flag to true.

To enable execution tracing, the following log4j configuration properties are recommended and can be customized accordingly:

  • log4j.appender.compliance=org.apache.log4j.RollingFileAppender
  • log4j.appender.compliance.layout=org.apache.log4j.PatternLayout
  • log4j.appender.compliance.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %m%n
  • log4j.appender.compliance.File=compliance.log
  • log4j.appender.compliance.MaxFileSize=2000KB
  • log4j.appender.compliance.MaxBackupIndex=1

You can set these properties using the local application server's log4j.properties file or add them as values in the application registry under the /system/log4j folder. (The specific location of the logging configuration can vary from server to server. For more details, contact your server administrator.)