Log4j2 customization
From Fix Pack 30 onwards, log4j2 is a default logging API used by the
Sterling™ Order Management System Software. Unlike previous version of log4j, the out-of-the box configuration
does not read from a file by default. All the configuration for logging framework is now done
pro-grammatically during application startup.
However, if the default logging configuration doesn't meet your needs, it is possible to configure to read from the custom log4j2 configuration.
Default Configuration
By default, there are multiple file appender, and one
console appender is configured for different java packages in the Sterling Order Management System Software. To
view the complete configuration, see log4j2.xml.sample present at
<runtime>/properties.
Important:
- For application server logs, you can view the logs printed by your applications server's console
in the following locations:
- For WebSphere Application Server: <WAS profile>/logs/<servername>/SystemOut.log
- For Liberty: <server dir>/logs/messages.log
- Runtime: <runtime>/logs/sci**.log
- For agent/integration server logs, you can view the logs that are generated at <runtime>/logs/sci**.log and <runtime>/logs/agentserver**.log.
- Sterling Order Management System Software doesn't read the default log4j2.xml file that is documented in the official log4j2 Apache documentation for configuration, instead reads it from log4j2_extra.xml present at <runtime>/properties.
- By default the log4j2_extra.xml that is present at <runtime>/properties doesn't contain any configuration.
- Any content that is added to log4j2_extra.xml that is present at <runtime>/properties gets appended to default configuration done by Sterling Order Management System Software, unless default configuration is disabled as explained in step #4 of customizing log4j2.
- Logging of
org.apache.struts2andcom.opensymphony.xwork2is also driven through thelog4j2_extra.xmlfiles instead ofWUFConsolelogs in the System Management Console.