问题描述
我尝试在tibco bw/Designer中设置自定义log4j附录.
我添加到<tibco_folder>/bw/5.11/lib/log4j.xml以下appender:
<appender name="TestFile" class="org.apache.log4j.FileAppender"> <param name="file" value="d:/temp/tibco-test.log"/> <param name="Threshold" value="DEBUG"/> <param name="append" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{yyyy MMM dd HH:mm:ss:SSS 'GMT'} %X{offset} %X{engine} %X{role} [%X{msgCategory}] %X{msgcode} %m %n"/> </layout> </appender>
,然后我在每个记录器中添加了<appender-ref ref="TestFile"/>,包括tibco_bw_log appender旁边.这些消息发送到tibco_bw_log,但没有发送给我的appender.
我的appender仅获得一些日志,如下所示,未出现在tibco_bw_log appender(c:\Users\<me>\.TIBCO\logs\<app_name>.log)
中的日志2017 Feb 21 17:05:16:693 GMT [] no system property set, defaulting to entrust61 since got class com.entrust.toolkit.security.provider.Initializer 2017 Feb 21 17:05:16:698 GMT [] getVendor()=entrust61 2017 Feb 21 17:05:16:719 GMT [] Initializing Entrust crypto provider in NON FIPS 140-2 mode; insert provider as normal 2017 Feb 21 17:05:17:302 GMT [] using X9_31usingDESede 2017 Feb 21 17:05:18:021 GMT [] getVendor()=entrust61 2017 Feb 21 17:05:18:023 GMT [] Initialized crypto vendor entrust61 java.lang.Exception: FOR TRACING ONLY -- NOT AN ERROR at com.tibco.security.impl.new.F.init(CryptoVendor.java:69) ...
即使我从bw.logger中删除了tibco_bw_log appender,日志仍在那里,而不是我的记录器.我将我的附录名称更改为tibco_bw_log并删除了原始的appender,但是后来我遇到了错误:" org.apache.log4j.fileappender不能被施加到com.tibco.share.util.bwlogfileappender".
现在我什至没有出现错误,但是我的appender没有任何日志.
每次更改log4j.xml文件时,我都会重新启动设计器.我还对log4j.properties进行了相同的更改,甚至将其删除.似乎log4j.xml无论如何都在优先.
我还尝试指定bwengine.xml in bwengine.xml的完整路径,并添加以下两个属性(如图所示在这里) - 无效.
<property> <name>bw.engine.showInput</name> <option>bw.log4j.configuration</option> <default>true</default> <description>Log4j Configuration file path</description> </property> <property> <name>bw.engine.showOutput</name> <option>bw.log4j.configuration</option> <default>true</default> <description>Log4j Configuration file path</description> </property>
我正在使用BW 5.11和Designer 5.8.
我缺少什么?
推荐答案
不幸的是,这在TIBCO中是不可能的.只能与自定义登录器一起使用Java活动.
问题描述
I tried to setup custom Log4J appenders in Tibco BW/Designer.
I added to <tibco_folder>/bw/5.11/lib/log4j.xml the following appender:
<appender name="TestFile" class="org.apache.log4j.FileAppender"> <param name="file" value="d:/temp/tibco-test.log"/> <param name="Threshold" value="DEBUG"/> <param name="append" value="true"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{yyyy MMM dd HH:mm:ss:SSS 'GMT'} %X{offset} %X{engine} %X{role} [%X{msgCategory}] %X{msgcode} %m %n"/> </layout> </appender>
and then I added <appender-ref ref="TestFile"/> to each logger, including bw.logger, beside the tibco_bw_log appender. The messages are sent to tibco_bw_log, but not to my appender.
My appender is getting only some logs like the below, logs that don't appear in tibco_bw_log appender (c:\Users\<me>\.TIBCO\logs\<app_name>.log)
2017 Feb 21 17:05:16:693 GMT [] no system property set, defaulting to entrust61 since got class com.entrust.toolkit.security.provider.Initializer 2017 Feb 21 17:05:16:698 GMT [] getVendor()=entrust61 2017 Feb 21 17:05:16:719 GMT [] Initializing Entrust crypto provider in NON FIPS 140-2 mode; insert provider as normal 2017 Feb 21 17:05:17:302 GMT [] using X9_31usingDESede 2017 Feb 21 17:05:18:021 GMT [] getVendor()=entrust61 2017 Feb 21 17:05:18:023 GMT [] Initialized crypto vendor entrust61 java.lang.Exception: FOR TRACING ONLY -- NOT AN ERROR at com.tibco.security.impl.new.F.init(CryptoVendor.java:69) ...
Even if I remove the tibco_bw_log appender from bw.logger, the logs are still going there and not to my logger. I changed my appender name to tibco_bw_log and removed the original appender, but then I was getting the error: "org.apache.log4j.FileAppender cannot be cast to com.tibco.share.util.BWLogFileAppender".
Now I don't even get that error, but my appender does not get any logs.
Every time I changed the log4j.xml file, I restarted the Designer. I also applied the same changes to log4j.properties and even removed it. It seems that log4j.xml is taking priority anyway.
I also tried to specify the full path of log4j.xml in bwengine.xml for bw.log4j.configuration and adding the two below properties (as shown here) - no effect.
<property> <name>bw.engine.showInput</name> <option>bw.log4j.configuration</option> <default>true</default> <description>Log4j Configuration file path</description> </property> <property> <name>bw.engine.showOutput</name> <option>bw.log4j.configuration</option> <default>true</default> <description>Log4j Configuration file path</description> </property>
I'm using BW 5.11 and Designer 5.8.
What am I missing?
推荐答案
Unfortunately this is not possible in Tibco. Only Java activities can be used with custom loggers.