logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pras P." <ponn...@gmail.com>
Subject How to configure JMSAppender in JBoss?
Date Sat, 01 Nov 2008 18:41:09 GMT
Hello All,

I'm trying to configure JMSAppender in JBoss 4.2.3 using the built in JBoss MQ.
The JBoss MQ is not up when log4j is configured causing it to error out.
Here's what I've tried.

I modified the root jboss-log4j.xml (at server/default/conf) to enable
the appender.

      <appender name="TESTLOGGINGJMS" class="org.apache.log4j.net.JMSAppender">
        <param name="Threshold" value="ERROR"/>
        <param name="ProviderURL" value="localhost" />
        <param name="InitialContextFactoryName"
value="org.jnp.interfaces.NamingContextFactory" />
        <param name="URLPkgPrefixes" value="org.jboss.naming
rg.jnp.interfaces" />
        <param name="TopicConnectionFactoryBindingName"
value="TopicConnectionFactory"/>
        <param name="TopicBindingName" value="topic/loggingTopic"/>
      </appender>


I add my own logger to the same file as
Code:

        <logger name="com.prpo" additivity="false">
       <appender-ref ref="TESTLOGGINGJMS" />
      </logger>


When I start the jboss server, looks like the server is waiting for
the topic to be created.
And throws an exception saying

Code:

    14:26:34,627 INFO  [Log4jService$URLWatchTimerTask] Configuring
from URL: resource:jboss-log4j.
xml
   log4j:ERROR Error while activating options for appender named
[TESTLOGGINGJMS].
   javax.naming.CommunicationException: Could not obtain connection
to any of these urls: localhost
 and discovery failed with error: javax.naming.CommunicationException:
Receive timed out [Root excep
tion is java.net.SocketTimeoutException: Receive timed out] [Root
exception is javax.naming.Communic
ationException: Failed to connect to server localhost:1099 [Root
exception is javax.naming.ServiceUn
availableException: Failed to connect to server localhost:1099 [Root
exception is java.net.ConnectEx
ception: Connection refused]]]



This is because the JMS topic is not created yet. I create the topic
via a -service.xml file using MBeans.

How can I delay initializing the log4j appender until the topic is created?

thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message