activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Fernandez <joe.fernan...@ttmsolutions.com>
Subject Re: log4j - Jndi context addToEnvironment has no effect
Date Thu, 29 Jan 2009 18:15:45 GMT

Are you extending Jamie Tsao's JMSQueueAppender?

Is your activateOptions() method being called prior to you setting the
PROVIDER_URL?

Joe
Free ActiveMQ user guide @ http://www.ttmsolutions.com



selezovikj wrote:
> 
> 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-tp21731483p21732535.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message