?
Solved

Log4j Web application

Posted on 2012-08-17
7
Medium Priority
?
671 Views
Last Modified: 2012-08-21
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
0
Comment
Question by:gudii9
  • 3
  • 3
7 Comments
 
LVL 10
ID: 38306246
Try this site
http://www.roseindia.net/software-tutorials/detail/21998

it has good examples.
0
 
LVL 7

Author Comment

by:gudii9
ID: 38306327
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
0
 
LVL 10

Accepted Solution

by:
krishna kishore mellacheruvu venkata earned 2000 total points
ID: 38306486
you need to download the log4j.jar from the following link

http://logging.apache.org/log4j/2.x/download.html
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Author Comment

by:gudii9
ID: 38311854
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
0
 
LVL 7

Author Comment

by:gudii9
ID: 38313217
0
 
LVL 10
ID: 38313293
good. So is it working now?
0
 
LVL 11

Expert Comment

by:Manish
ID: 38315684
Just do ctrl+shift+T and search Logger in that...see how may jars are there?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question