How to write log to a seperate file using log4j in TIBCO BusinessEvents.

How to write log to a seperate file using log4j in TIBCO BusinessEvents.

book

Article ID: KB0091161

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
Description:
==========
The customer implemented their log functions as CustomFunction using log4j and wants to write the log into a seperate log file.

Environment:
==========
TIBCO BusinessEvents - 4.x, 5.x
OS - all

Resolution:
=========

1). In the log4j.properties:
###################################
# to write to both custom log and BE log, you add "tibco_be_log" to log4j.logger.reportsLog
# to write to custom log only, you don't add "tibco_be_log"
log4j.logger.reportsLog=INFO, ats_log_file
log4j.appender.ats_log_file=org.apache.log4j.RollingFileAppender
log4j.appender.ats_log_file.File=c:/temp/my_log4j.log
log4j.appender.ats_log_file.MaxFileSize=500KB
log4j.appender.ats_log_file.MaxBackupIndex=2
log4j.appender.ats_log_file.layout=org.apache.log4j.PatternLayout
log4j.appender.ats_log_file.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
###################################

2). In the be-engine.tra file, add blow, pointing to your own log4j.properties
java.extended.properties -Dlog4j.configuration=file:///C:/be510/be/5.1/lib/log4j.properties

An example project is also attached to this solution.

Issue/Introduction

How to write log to a seperate file using log4j in TIBCO BusinessEvents.

Attachments

How to write log to a seperate file using log4j in TIBCO BusinessEvents. get_app