Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Not Applicable | - |
Resolution:
Description:
==========
Configuring custom Log4j properties with TIBCO BusinessEvents..
Environment:
==========
TIBCO BusinessEvents - 2.x, 3.x
OS - ALL
Resolution:
=========
You can override the default BE logging mechanism to custom Log4j framework. Create a custom implement of the com.tibco.cep.kernel.service.Logger interface which wraps around Log4j (See attached. Filenames: Log4jLogger.java, DynamicFileAppender.java).
Set the following log4J properies:
java.property.com.tibco.cep.logger.factory=com.tibco.be.functions.log.Log4jLogger
gig.appender=be_log
BE will pick up a log4j.properties file from your classpath. The first one found is used. One sugestion is to put it in <tibco_home>/be/2.2/lib. This will work from the command line but will not work when running from Studio in TIBCO BusinessEvents (BE) 4.0.1 or 5.0.0. Instead the files need to be in <tibco_home>/be/5.0/lib/ext. Here is the one which is used for this sample:
log4j.logger.be.logger=INFO, be_log
log4j.appender.be_log=com.tibco.be.functions.log.DynamicFileAppender
log4j.appender.be_log.File='router.log'
log4j.appender.be_log.FilePattern='%%gig.log_dir%%/apps/router_%%be.engine.name%%_'yyyyMMddHH'.log'
log4j.appender.be_log.layout=org.apache.log4j.PatternLayout
log4j.appender.be_log.layout.ConversionPattern=%d{ISO8601} %X{engine} %X{role} [%t] - %m%n