IBM Support

How to update log4j v2 configuration files after upgrading to Engineering Lifecycle Management 7.0.2 SR1 (iFix015) and 7.0.1 SR1 (iFix018)

How To


Summary

With the adoption of Log4J version 2, and the removal of Log4J version 1, several changes had to happen. Functionally, the logging changes are minor. We introduced more consistency across the ELM suite of products, and we are using the latest (version 2) release of Log4J to address security concerns.

Objective

The list of the functional changes:
  • Log4J logging configuration syntax changes. For more information, see Configuring Log4J on the log4j.apache.org website.
  • Log4J configuration file names change from log4j.properties to log4j2.xml.
  • Log events now produce ISO8601 compliant date and time stamps.
  • Roll over log file names default to [context root]-#.log versus the old [context root].log.#
    • Example: Jts-1.log versus jts.log.1
  • Property files are now well-formed XML.
NOTE: If you made changes to the default log4j.properties file, you would need to capture those changes, and make the equivalent changes in the new log4j2.xml file (See Migrating from log4j v1 to v2). If you are comfortable with the default settings, no further action is required. 

Environment

Engineering Lifecycle Management applications 7.0.2 SR1 and higher and 7.0.1 SR1 and higher.

Steps

Installation
See Side-by-side installation instructions.
Log file locations
The log-file names remain unchanged unless you change the context root or override the default log file name in the log4j2.xml file.
The default log file names are:
  • jts.log
  • ccm.log
  • rm.log
  • qm.log
  • lqe.log
  • ldx.log
  • dcc.log
  • rs.log
  • gc.log
  • relm.log
By default, the location of application-specific log files does not change.
  • WebSphere Application Server: [WebSphere Install Dir]/profiles/[profile name]/logs
  • WebSphere Application Server, Liberty Profile: [ELM Install Dir]/server/liberty/servers/clm/logs
    • We attempt to create a symbolic link to [ELM Install Dir]/server/logs (if we don’t have permission, it is not created)
Log4j2.xml locations
Configuration files are automatically loaded at start-up and reloaded when changes are detected in the file (approximately 10 seconds). 
The log4j2.xml files can be found in the following folders:
  • [ELM Install Dir]/server/conf/jts/
    • log4j2.xml
  • [ELM Install Dir]/server/conf/ccm/
    • log4j2.xml
  • [ELM Install Dir]/server/conf/rm/
    • log4j2.xml
    • repotools-rm-log4j2.xml
  • [ELM Install Dir]/server/conf/qm/
    • log4j2.xml
  • [ELM Install Dir]/server/conf/lqe/
    • ​​​​​​​log4j2.xml
  • [ELM Install Dir]/server/conf/ldx/
    • ​​​​​​​​​​​​​​log4j2.xml
  • [ELM Install Dir]/server/conf/gc/
    • ​​​​​​​​​​​​​​log4j2.xml
  • [ELM Install Dir]/server/conf/rs/
    • ​​​​​​​​​​​​​​log4j2.xml
  • [ELM Install Dir]/server/conf/dcc/
    • ​​​​​​​​​​​​​​log4j2.xml
  • [ELM Install Dir]/server/conf/relm/
    • ​​​​​​​​​​​​​​log4j2.xml
  • [ELM Install Dir]/server/conf
    • repotools_log4j2.xml
    • startup_log4j2.xml
By modifying the log4j2.xml file, you can:
  • Set the log level; off, fatal, error, warning, informational, debug, trace, all. The default is WARN. 
  • Change the log file size and rotation policy
  • Change what components are logged.

Customizing Log4J 2
Here are some common examples of log4j customizations we see in the field. We provide the default and example customization.
For more customizations or examples, see the log4j documentation on the Apache.org website. 
Changing the default log size
Default: <SizeBasedTriggeringPolicy size=”10MB” />
Example:  <SizeBasedTriggeringPolicy size=”75MB” />
Changing the size-based rollover strategy (number of logs you keep)
Default: <DefaultRolloverStrategy max=”5” />
Example: <DefaultRolloverStrategy max=”10” /> 
Changing the log level
Default:  
<Root level=”WARN”>
    <!-- <AppenderRef ref=”stdout” /> -->
    <AppenderRef ref=”fileLogger” />
</Root>
Example:
<Root level=”TRACE”>
    <!-- <AppenderRef ref=”stdout” /> -->
    <AppenderRef ref=”fileLogger” />
</Root>
Changing the timestamp
Default: 
<PatternLayout>
    <pattern>%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%30t] [%x] %5p %c %X{Tid} - %m%n</pattern>
</PatternLayout>
Example:
<PatternLayout>
    <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%30t] %5p %-50.50c %X{Tid} -%m%n"</pattern>
</PatternLayout>
Changing the name of the roll-over log file
Set the roll-over log file name to jts.log.1 instead of the default jts-1.log
Default:
<RollingFile name=”fileLogger” filename=”${dir}/${app}.log” filePattern=”${dir}/${app}-%i.log”>
    …
</RollingFile>
Example:
<RollingFile name=”fileLogger” filename=”${dir}/${app}.log” filePattern=”${dir}/${app}.log.%i”>
    …
</RollingFile>

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSPRJQ","label":"IBM Engineering Lifecycle Management Base"},"ARM Category":[{"code":"a8m0z000000CbPJAA0","label":"Jazz Team Server-\u003EUpgrade"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0.2;and future releases"},{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSUC3U","label":"IBM Engineering Workflow Management"},"ARM Category":[{"code":"a8m0z000000CbPJAA0","label":"Jazz Team Server-\u003EUpgrade"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0.2;and future releases"},{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSUVLZ","label":"IBM Engineering Requirements Management DOORS Next"},"ARM Category":[{"code":"a8m0z000000CbPJAA0","label":"Jazz Team Server-\u003EUpgrade"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0.2;and future releases"},{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSUVV6","label":"IBM Engineering Test Management"},"ARM Category":[{"code":"a8m0z000000CbPJAA0","label":"Jazz Team Server-\u003EUpgrade"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0.2;and future releases"}]

Document Information

Modified date:
29 August 2022

UID

ibm16606799