gudii9
asked on
Log4j Web application
I am looking for simple webapplication with Log4j Logging. I would like to learn how to use Log4j for logging purpose in simple web applications.Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
ASKER
How do I enable log4j in my project. Do I need to download and put a jar in web-inf/lib or some other steps needs to be done. Please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
When I try to run the example getting compilation error like 'indirectly reference in .class file' as in the attachment. I did downloaded the log4j zip foilder and extracted and copied the jar file and pasted under my eclipse Log4J project ---web-inf/lib.
Then I right clicked on the project went to Java Build Path----Jar---Add JArs jars--select the pasted log4j jar under web-inf/lib.
I am not sure why the error is coming. Am I doing some thing wrong. Please advise.
Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
log4j1.JPG
log4j2.JPG
log4j3.JPG
Then I right clicked on the project went to Java Build Path----Jar---Add JArs jars--select the pasted log4j jar under web-inf/lib.
I am not sure why the error is coming. Am I doing some thing wrong. Please advise.
Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
log4j1.JPG
log4j2.JPG
log4j3.JPG
ASKER
I got running example from here
http://www.dzone.com/tutorials/java/log4j/log4j-configuration.html
and log4j from this sample example
http://www.laliluna.de/articles/posts/log4j-tutorial.html
Log4jRunning.JPG
http://www.dzone.com/tutorials/java/log4j/log4j-configuration.html
and log4j from this sample example
http://www.laliluna.de/articles/posts/log4j-tutorial.html
Log4jRunning.JPG
good. So is it working now?
Just do ctrl+shift+T and search Logger in that...see how may jars are there?
http://www.roseindia.net/software-tutorials/detail/21998
it has good examples.