[logback-user] Failover/reconfigure JMSAppender on JNDI InitialContext
rutgersaalmink at hotmail.com
Mon Jul 20 14:16:07 CEST 2015
I am running into an issue when using the JMSQueueAppender on Weblogic application server, where application code talks to SLF4j with Logback as the underlying logging framework (core+classic).Below my logback.xml configuration. In this scenario, SLF4j is being initialized before the JNDI context is available from Weblogic, thus resulting an error like:1:01:19,348 |-ERROR in ch.qos.logback.classic.net.JMSQueueAppender[JMSQueue] - Error while activating options for appender named [JMSQueue]. javax.naming.NoInitialContextException: JNDI subsystem is not ready for use at javax.naming.NoInitialContextException: JNDI subsystem is not ready for use at weblogic.jndi.WLInitialContextFactoryDelegate.newLocalContext(WLInitialContextFactoryDelegate.java:569)... stacktrace omitted ...
Is there any reconnection/retrycount property that can be set on the JMSQueueAppender (can't find documentation about it online manual)? Or any other way of re-initialization?
(N.b. a workaround would be: define scan="true" scanPeriod="10 seconds", perform a unix 'touch' on logback.xml manually, which will reconfigure the appender. But by then we might have missed a lot of critical logging not being sent to the JMS queue).
Copy of JMS appender definition in logback.xml:
<appender name="JMSQueue" class="ch.qos.logback.classic.net.JMSQueueAppender"> <InitialContextFactoryName> weblogic.jndi.WLInitialContextFactory </InitialContextFactoryName> <ProviderURL>t3://localhost:7001</ProviderURL> <QueueConnectionFactoryBindingName> weblogic.jms.ConnectionFactory </QueueConnectionFactoryBindingName> <QueueBindingName>jms/foo/barQueue</QueueBindingName> </appender>.... <logger name="foo.bar.baz" level="INFO"> <appender-ref ref="JMSQueue"/> </logger>
Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Logback-user