Reputation: 9237
I am receiving this warning which interrupts the running of my web application.
log4j:WARN No appenders could be found for logger (smslib).
log4j:WARN Please initialize the log4j system properly.
I have the log4j JAR file in my library. I have deleted it and added it again ... this warning keeps showing up.
Thanks for your time,
Upvotes: 0
Views: 2060
Reputation: 113
For small stand-alone programs and unit tests, I use BasicConfigurator
.
To init:
BasicConfigurator.configure();
To cleanup:
BasicConfigurator.resetConfiguration();
If you're using JUnit, you should generally remember to place the cleanup code in your @After/tearDown(), since the configure() method adds a console appender if log4j had already been initialized.
Upvotes: 5
Reputation: 1500055
Well log4j is clearly being found, otherwise it couldn't be warning you like this!
What's more likely to be missing is a log4j configuration. There are lots of ways you can do this in a web application - how are you trying?
Upvotes: 2