Customizing log4j configuration by using differential extensibility

Update the custom log4jconfig.xml file. The system overlays your changes on the application-provided log4jconfig.xml file.

About this task

Next-generation platformDo not change any existing appender elements. Changes to appender elements might stop the log collection process, prevent you from exporting logs in the Self Service tool, and prevent you from viewing log files in Graylog. Do not add appender elements. The system collects log files from the default appender elements.


  1. Create a custom log4jconfig.xml file in the <runtime_sandbox>/extensions/global/resources/deltalog4jconfig directory. The custom log4jconfig.xml file should be a valid XML file in the same format.
  2. In the log4jconfig.xml file, add only the differential overrides and custom categories or appenders.
    Consider the following application-provided appender:
    <appender name="ALL" class="com.sterlingcommerce.woodstock.util.frame.logex.SCIAppender">
            <param name="rotateLogs" value="true" />
            <param name="maxLogSize" value="100000" />
            <param name="maxNumLogs" value="10" />
            <param name="file" value="/opt/OM/runtime/logs/sci${IBM_LOG_FILE}.log" />
            <layout class="com.sterlingcommerce.woodstock.util.frame.logex.SCICommonLayout">
                <param name="ConversionPatternRef" value="appender.ALL.pattern"/>
                <param name="DefaultConversionPattern" value="%d:%-7p:%t: %-60m [%X{AppUserId}]: [%X{TenantId}]: %-25c{1}%n"/>
            <filter class="com.sterlingcommerce.woodstock.util.frame.logex.SCICommonFilter" />
            <filter class="com.sterlingcommerce.woodstock.util.frame.logex.SCIPatternFilter" />
    Note: To remove an element, pass remove = "true" corresponding to the element in the XML.
    To use differential extensibility for the application-provided appender, override the appender in the <runtime_sandbox>/extensions/global/resources/deltalog4jconfig/log4jconfig.xml file.
       <appender name="ALL" >
            <param name="rotateLogs" value="false" />
            <param name="maxNumLogs" remove="true"/>
            <param name="file" value="/opt/SSFS_9.5/runtime/logs/sci${IBM_LOG_FILE}_custom.log" />
            <layout class="com.sterlingcommerce.woodstock.util.frame.logex.SCICommonLayout">
                <param name="ConversionPatternRef" value="appender.ALL.pattern"/>
                <param name="DefaultConversionPattern" value="%d:%-8p:%t: %-60m [%X{AppUserId}]: [%X{TenantId}]: %-25c{1}%n"/>
            <filter class="com.abcdcorp.CustomFilter" />
    Note: Merging of elements is done only at the first level of child elements and not their children. Therefore, in the example, even if there is no change to the ConversionPatternRef parameter, the complete layout element be specified in the differential file.
    Consider the following application-provided category:
    <category  name="" class="com.yantra.yfc.log.YFCLogCategory" additivity="false" >
            <level class="com.yantra.yfc.log.YFCLogLevel" value="WARN"  />
             <appender-ref ref="CONSOLE" />
            <appender-ref ref="ALL" />
    To use differential extensibility for the application-provided category, modify the category in the <runtime_sandbox>/extensions/global/resources/deltalog4jconfig/log4jconfig.xml file.
       <category name="">
            <appender-ref ref="CONSOLE" remove="true"/>
            <appender-ref ref="CUSTOM_APPENDER" />