This article is specific to Brazos UI for IBM BPM External User Interfaces. Brazos UI utilizes Log4j2 as its logging framework. This article explains how to customize the logging configuration.
Changing the default logging
The log levels and appenders may be overridden by providing a custom log4j2.xml file and referencing it through a JVM argument. A sample log4j2.xml file is attached that changes the Brazos UI logging log level to debug. It can be placed anywhere on the server's file system.
To enable the use of this configuration file:
- Download the sample log4j2.xml to the server file system (ex:
- Login to the WAS Admin Console
- Go to Servers -> Server Type -> WebSphere Application Server
- From the table, click the link for the server that you have the Brazos UI installed on
- In the Server Infrastructure section, expand Java and Process Management and click the Process definition link
- In the Additional Properties section, click the Java Virtual Machine link
- In the box labeled Generic JVM Arguments, add
-Dlog4j.configurationFile=file:<file location> (ex:
- Save the changes
- Navigate to Servers -> Server Type -> WebSphere Application Server
- From the table, select the server that you have the Brazos UI installed on and click the Restart button from the button group at the top of the table to restart the server
When configured from a File, Log4j2 has the ability to automatically detect changes to the configuration file and reconfigure itself without having to restart the server. If the monitorInterval attribute is specified on the configuration element and is set to a non-zero value then the file will be checked the next time a log event is evaluated and/or logged and the monitorInterval has elapsed since the last check. The attached file log4j2.xml shows how to configure the attribute so that the configuration file will be checked for changes only after at least 30 seconds have elapsed. The minimum interval is 5 seconds.
Servers with existing Log4j2 configuration
If Log4j2 has been configured on the server already, then the existing configuration needs to be modified to include Brazos UI. We recommend that you add all of the appenders and loggers defined in the attached log4j2.xml file to your existing configuration file.
For more information regarding Log4j2 configuration, visit https://logging.apache.org/log4j/2.x/