IBM Support

Change in logging framework from log4j to logback for zookeeper in Global Mailbox v6122 and higher

How To


Summary

Steps for changing the log file name and rolling setting for zookeeper in B2BI/Global Mailbox v6.1.2.2 and higher.

Objective

How to change the log file name from the default outbox logging framework for zookeper's new logging framework in B2Bi/Global Mailbox v6.1.2.2 and higher. 

Environment

All environments

Steps

Global Mailbox/B2Bi v6.1.2.2 uses Zookeeper version 3.8. The zookeeper version 3.8 does not use log4j framework anymore due to  Log4j vulnerabilities. It rather uses logback framework for logging. This is the reason you DO NOT see log4j.properties file in /apps/ibm/gm/zookeeper/conf directory path. However, you must see logback.xml file instead and you should be able to control the logging setting using this file
 

With out of box settings of the newer logging framework, zookeeper logs are written in a file named Zookeeper.out and this file does not roll over. In order to get the logs written to a different file, i.e. Zookeeper.log, and enable the rolling of log files, please make the below changes in the logback.xml file in <GlobalMailbox Install>/zookeeper/conf directory path:

uncomment the section of code in the logback.xml. The section starts on line 50 and ends on line 65.

Starting line:

<!--appender name="ROLLINGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">

Ending line:

</appender-->

Edit below line:

<property name="zookeeper.log.file" value="zookeeper.log" />

And change the maxfilesize value to 1 MB(you can give the size as per your requirement), like this:

<property name="zookeeper.log.maxfilesize" value="1MB" />

Provide the absolute path <property name="zookeeper.log.dir" value="<GM Install location>/zookeeper/logs" />

Add the ROLLINGFILE at the root level and

<root level="INFO">

  <appender-ref ref="CONSOLE" />

  <appender-ref ref="ROLLINGFILE" />

 </root>

Post this, restart the zookeeper using the scripts stopGMCoordinate.sh to stop and startGMCoordinate.sh to start from <GlobalMailbox Install>/MailboxUtilities/bin/ directory.

Please note,  post these changes, zookeeper will still write the same logs in Zookeeper.out as well along with the new log file(zookeeper.log) name configured in logback.xml file.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"","label":""},"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Product":{"code":"SS6EA4","label":"IBM Global High Availability Mailbox"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Product Synonym

B2Bi SBI SI GM Global Mailbox GDHA

Document Information

Modified date:
21 July 2023

UID

ibm17013901