activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <james.strac...@gmail.com>
Subject Re: log4j - Jndi context addToEnvironment has no effect
Date Thu, 29 Jan 2009 17:30:39 GMT
Have you tried just configuring whatever properties you need as a
Hashtable and passing them into the InitialContext() constructor?

2009/1/29 selezovikj <semir.elezovic@gmail.com>:
>
> I have a JmsQueueAppender that logs messages to an ActiveMQ broker on a given
> queue.
> I also have a jndi.properties file in which I do NOT specify the
> provider.url value, because that value can vary depending on a flag.
>
> In my JmsQueueAppender, the jndi context is initialized using the default
> no-argument constructor.
>
>
> jndi = new InitialContext();
> System.out.println(jndi.getEnvironment().toString());
>
> Printing the environment values which are gotten using the default
> constructor results with the following values which I have specified in my
> jndi.properties file:
> {java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory,
> queue.LoggingQueue=LoggingQueue}
>
> Later I add to the environment the provider.url value.
>
> jndi.addToEnvironment(Context.PROVIDER_URL,
> "failover:(tcp://localhost:61617)");
> System.out.println(jndi.getEnvironment().toString());
>
> results with:
> {java.naming.provider.url=failover:(tcp://localhost:61617),
> java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory,
> queue.LoggingQueue=LoggingQueue}
>
> Even though, the provider.url is added to the environment, when logging
> log4j does not take into account the provider url I just specified. It
> simply does not log to 61617.
>
> Any help with this ? ? ?
> --
> View this message in context: http://www.nabble.com/log4j---Jndi-context-addToEnvironment-has-no-effect-tp21731483p21731483.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Mime
View raw message