I\'m trying to run this example, but I have some problems with configuration.
I copied log4j-jms.properties
, jndi.properties
, Log4jJMSApp
Your log4j.properties
should reside inside the src
folder. That way, Log4J will configure itself automatically, without you needing to write code.
According to your project structure, there is no log4j-jms.properties.There is log4j.properties. So change your log4j properties file name.
There is nothing about imports;
It's not about the file place, as you see this message "log4j:WARN No appenders could be found for logger...", so please check the content of your log4j configuration file. Here's a demo:
log4j.rootLogger=INFO, myConsoleAppender log4j.appender.myConsoleAppender=org.apache.log4j.ConsoleAppender log4j.appender.myConsoleAppender.layout=org.apache.log4j.PatternLayout log4j.appender.myConsoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
The default log4j configuration file is "log4j.properties", and as someone had said it should be place in the src
folder.