I am trying to run this example , but I have some configuration problems.
I copied log4j-jms.properties, jndi.properties,Log4jJMSAppenderExample.java
ProjectJMS
|
\_ src
| \_ Log4jJMSAppenderExample.java
| \_ jndi.propeties
\_ log4j-jms.properties
and run activemqin my console.
When I ran my example, I got
log4j:WARN No appenders could be found for logger (org.apache.activemq.transport.WireFormatNegotiator).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html
so i added
PropertyConfigurator.configure("log4j-jms.properties");
Now I can see the logs in the Eclipse console, but still with this warning
log4j:WARN No appenders could be found for logger (org.apache.activemq.transport.WireFormatNegotiator).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html
2012-08-13 10:21:44,741 INFO Log4jJMSAppenderExample - Test log
Received log [INFO]: Test log
and in console with activemqi got
WARN | Transport Connection to: tcp://127.0.0.1:2005 failed: java.net.SocketException: Connection reset
Why am I getting these warnings?
Is my import wrong?
import javax.jms.Connection;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.Session;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQObjectMessage;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.spi.LoggingEvent;
Are my files in the wrong place?
How to install configuration file in Eclipse? Without use PropertyConfigurator.configure("log4j-jms.properties");? There is no such line in the example below.
source
share