KB Article #179889

how to control the size of javaMapBroker.log

Problem

-- when using java module such as Webservice FrontEnd Provider, it generates logs in the $CORE_DATA/log/javaMapBroker.log

$ ls -l javaM*

rw-rr- 1 axway staff 1696326 Jun 12 15:54 javaMapBroker.log

-- CORE_DELETE_MAPPING_LOG has no effect on this file

-- is there a way to control the maximum size of this file and the number of file created ?

Resolution

* The log properties $CORE_ROOT/config/java/log4j.properties file provides variables to manage this file :

- log4j.appender.integrator.maxFileSize is the maximum size that the JavaMapBroker.log can have before being backed up and rolled to javaMapBroker.log.1.

- log4j.appender.integrator.maxBackupIndex defines the maximum number of backed up JavaMapBroker.log.* files that will be kept on the system.

By default, the following settings are defined:
log4j.appender.integrator.maxFileSize=25000KB
log4j.appender.integrator.maxBackupIndex=10

The above settings mean that the log file will be rolled if it exceeds 25000 kb, and a maximum number of 10 logs will be kept.

To configure max file size in mega-bytes, use MB as in 20MB.

* Integrator/B2Bi must be restarted, that the log4j.properties file changes take effect.

* log4j.properties cannot be copied in $CORE_LOCAL/config/java (it will not be taken into account), so the file must be backed-up when doing an upgrade or an install, otherwise, it will be overwritten.