Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Sample Use-case:
Redirect all INFO and above level entries to one log file, all WARNINGs and above to one log file and all ERRORs and above to one log file for better tracking and monitoring purpose. This is needed so that customers can keep an eye on critical errors and preserve the logs and timestamps especially when logs get rolled over very frequently.
>>>>>>>>>>>>>>>>>>>>>>>
2018 Mar 23 10:32:29.955 GMT-07:00 INFO [http.server.impl] - Channel server for HTTP Channel[Port:8109] starting
2018 Mar 23 10:32:29.967 GMT-07:00 INFO [http.server.impl] - Channel server for HTTP Channel[Port:8109] successfully started
2018 Mar 23 10:33:10.950 GMT-07:00 WARN [cep.driver.jms] - JMS FT event: [FT-SWITCH: Disconnected from tcp://localhost:7222, will attempt to reconnect] [Disconnected from tcp://localhost:7222, will attempt to reconnect]
2018 Mar 23 10:33:10.953 GMT-07:00 WARN [cep.driver.jms] - JMS FT event: [FT-SWITCH: Disconnected from tcp://localhost:7222, will attempt to reconnect] [Disconnected from tcp://localhost:7222, will attempt to reconnect]
2018 Mar 23 10:33:11.284 GMT-07:00 INFO [cep.driver.jms] - JMS FT event: [FT-SWITCH: Reconnecting to tcp://localhost:7222, attempt 1 out of 2] [Reconnecting to tcp://localhost:7222, attempt 1 out of 2]
2018 Mar 23 10:33:11.288 GMT-07:00 INFO [cep.driver.jms] - JMS FT event: [FT-SWITCH: Reconnecting to tcp://localhost:7222, attempt 1 out of 2] [Reconnecting to tcp://localhost:7222, attempt 1 out of 2]
2018 Mar 23 10:33:13.307 GMT-07:00 INFO [cep.driver.jms] - JMS FT event: [FT-SWITCH: Reconnecting to tcp://localhost:7222, attempt 1 out of 2] [Reconnecting to tcp://localhost:7222, attempt 1 out of 2]
2018 Mar 23 10:33:15.317 GMT-07:00 INFO [cep.driver.jms] - JMS FT event: [FT-SWITCH: Reconnecting to tcp://localhost:7222, attempt 1 out of 2] [Reconnecting to tcp://localhost:7222, attempt 1 out of 2]
2018 Mar 23 10:33:17.623 GMT-07:00 INFO [cep.driver.jms] - JMS FT event: [FT-SWITCH: Reconnecting to tcp://localhost:7222, attempt 2 out of 2] [Reconnecting to tcp://localhost:7222, attempt 2 out of 2]
2018 Mar 23 10:33:19.670 GMT-07:00 INFO [cep.driver.jms] - JMS FT event: [FT-SWITCH: Reconnecting to tcp://localhost:7222, attempt 2 out of 2] [Reconnecting to tcp://localhost:7222, attempt 2 out of 2]
2018 Mar 23 10:33:21.358 GMT-07:00 INFO [cep.driver.jms] - JMS FT event: [FT-SWITCH: Reconnecting to tcp://localhost:7222, attempt 2 out of 2] [Reconnecting to tcp://localhost:7222, attempt 2 out of 2]
2018 Mar 23 10:33:23.368 GMT-07:00 INFO [cep.driver.jms] - JMS FT event: [FT-SWITCH: Reconnecting to tcp://localhost:7222, attempt 2 out of 2] [Reconnecting to tcp://localhost:7222, attempt 2 out of 2]
2018 Mar 23 10:33:27.395 GMT-07:00 ERROR [cep.driver.jms] - JMS Exception [code]:null [message]:Connection has been terminated
2018 Mar 23 10:33:27.395 GMT-07:00 ERROR [cep.driver.jms] - JMS Exception [code]:null [message]:Connection has been terminated
2018 Mar 23 10:33:27.396 GMT-07:00 ERROR [cep.driver.jms] - JMS Linked exception [message]: Connection reset
2018 Mar 23 10:33:27.396 GMT-07:00 ERROR [cep.driver.jms] - JMS Linked exception [message]: Connection reset
2018 Mar 23 10:33:27.398 GMT-07:00 ERROR [cep.driver.jms] - Exception while receiving a JMS message => stopping the receiver, jmsSessionPerMessage:false, ack:true, ErrorCode:null, in: inference-class
javax.jms.JMSException: Connection has been terminated
at com.tibco.tibjms.TibjmsxSessionImp._getSyncMessage(TibjmsxSessionImp.java:2301)
at com.tibco.tibjms.TibjmsxSessionImp._receive(TibjmsxSessionImp.java:2122)
at com.tibco.tibjms.TibjmsMessageConsumer._receive(TibjmsMessageConsumer.java:276)
at com.tibco.tibjms.TibjmsMessageConsumer.receive(TibjmsMessageConsumer.java:481)
at com.tibco.cep.driver.jms.JmsReceiver.if(SourceFile:236)
at com.tibco.cep.driver.jms.JmsReceiver.call(SourceFile:133)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2018 Mar 23 10:33:27.399 GMT-07:00 INFO [cep.driver.jms] - Destination [/JMSChannel/jmsDest1] listener STOPPED for RuleSession [inference-class] {2}
2018 Mar 23 10:33:27.399 GMT-07:00 ERROR [cep.driver.jms] - Failed to recover JMS session in: inference-class
javax.jms.IllegalStateException: Session is closed
at com.tibco.tibjms.TibjmsxSessionImp._recover(TibjmsxSessionImp.java:2743)
at com.tibco.tibjms.TibjmsxSessionImp.recover(TibjmsxSessionImp.java:5246)
at com.tibco.cep.driver.jms.JmsReceiver.if(SourceFile:258)
at com.tibco.cep.driver.jms.JmsReceiver.call(SourceFile:133)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
<<<<<<<<<<<<<<<<<<<<<<<
<appender name="normal" class="org.apache.log4j.RollingFileAppender"> <param name="file" value="D:/WorkingSpaces/BE550/TEMP_64/normal.log"/> <param name="MaxFileSize" value="100MB"/> <param name="MaxBackupIndex" value="10"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{yyyy MMM dd HH:mm:ss.SSS 'GMT'XXX} %p [%c{3}] - %m%n"/> </layout> </appender> <appender name="Error" class="org.apache.log4j.RollingFileAppender"> <param name="file" value="D:/WorkingSpaces/BE550/TEMP_64/Error.log"/> <param name="MaxFileSize" value="100MB"/> <param name="MaxBackupIndex" value="10"/> <param name="threshold" value="error"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{yyyy MMM dd HH:mm:ss.SSS 'GMT'XXX} %p [%c{3}] - %m%n"/> </layout> </appender>3. Refer to appender in root logger
<root> <priority value ="info" /> <appender-ref ref="normal" /> <appender-ref ref="Error"/> </root>4. Add the following property in the be-engine.tra file to use this custom log4j configuration
java.property.log4j.configuration=[custom_log4j_path]Note: if the custom log4j file is not in the classpath but located elsewhere on your device, use the following in be-engine.tra file:
java.property.log4j.configuration=file:[custom_log4j_file_path]See attached log4j.xml for your reference. With this custom log4j, we defined the following appenders: