Capture warning messages in a file other than application log file for MQ plugin 7.x

Capture warning messages in a file other than application log file for MQ plugin 7.x

book

Article ID: KB0073086

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for IBM MQ -

Description

Sometimes customer wants to print warning messages into different file instead of application log file. For this we need to modify the log4j.xml file located in the folder <TIBCO_HOME>\bw\<bw_version>\lib.

Issue/Introduction

Capture warning messages in a file other than application log file for MQ plugin 7.x

Environment

OS= ALL, MQ Plugin version=7.x

Resolution

1) Go to location <TIBCO_HOME>\bw\<bw_version>\lib and add following lines before the tag </log4j:configuration> in log4j.xml file. Refer attached log4j.xml file:

<!-- *** New appender -->
<appender name="warn_log_file" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="C:/tmp/apache_warn.log"/>
<param name="MaxFileSize" value="5000KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
</layout>
</appender>

<!-- **** Sending Warning Message to different file -->
<logger name="bw.logger">
<level value ="WARN"/>
<appender-ref ref="warn_log_file"/>
</logger>

2)From above tags, please provide the file name along with the location for the parameter tag <param name="File" value="C:/tmp/apache_warn.log"/>. This is the location of file in which all the warning messages related to plugin will be printed instead of application logs. 

3)Restart the application. Now the new log file will be created automatically with file name provided in above step.

***Please note that MQ Plugin uses log4j logger 'bw.logger' to print log messages in BW Application logs which is defined in log4j.xml file. BW activities such as JavaCode and JavaMethod activities also uses 'bw.logger' to print log messages in Application logs. If any of the BW services having activities which uses internally logger 'bw.logger' to print messages in application logs, then those activities will be affected i.e the warning messages thrown by those activities will also get printed in separate file using this solution.

Additional Information

01657014

Attachments

Capture warning messages in a file other than application log file for MQ plugin 7.x get_app