Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

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
Avatar of krishna kishore mellacheruvu venkata
krishna kishore mellacheruvu venkata
Flag of India image

Try this site
http://www.roseindia.net/software-tutorials/detail/21998

it has good examples.
Avatar of gudii9

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
Avatar of krishna kishore mellacheruvu venkata
krishna kishore mellacheruvu venkata
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

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
good. So is it working now?
Just do ctrl+shift+T and search Logger in that...see how may jars are there?