See which of your colleagues or former colleagues are already on Java Link: Check out the Contact Finder
Java Web Servers » Tomcat » How to set Looger in tomcat

222 Views
  5 Replies

0
Vote Vote
How to set Looger in tomcat
Share  
 Type: Professional, Report if fun topic
Rahul
Rahul Picture
1 Posts
back to top
Posted 26-02-2009Reply

I want to implement logger functionality in Tomcat any one can help me in this

Kaustubhshobhan
Kaustubhshobhan Picture
2 Posts
back to top
  Rated 0 | Posted 26-02-2009

Apache Tomcat comes with default logger which logs the activity of the server.

How ever if you need to log from the Application you will need to have a logger entry in your project POM(The file where you declare the dependency for the jars) depending on which logging system you are using

Kaustubh

Intakhab
Intakhab Picture
82 Posts
back to top
  Rated 0 | Posted 02-03-2009

tom cat give u by default logger..so why u need that...if u write on console of server that will print in server...log file..u go server log file...

Sonal
Sonal Picture
13 Posts
back to top
  Rated 0 | Posted 13-03-2009

First of all, what do u want to do. R u asking about application log or server log. C.. if it is server log, that will be their in Tomcat directory under server logs folder.

But I think u want to configure logger for your application. Logging system of any king of application is not dependent on any king of server. It will not be specific to tomcat.

Use any framework for logging like Log4J. I think its best one.

I want to answer, question raised by one of the Forum member here. We require saparate log for application.Server log is not enough because it will contain all teh processing steps which r not required for our perpose. Our perpose is to debug our business fuctionality at develoment and production time.We can give log statement inside ur application for example any exception comes or any flow etc. At debugging u can check log.

Ur application log will contain logs which is specific to ur application not all junk data which comes on server log.

Ravindra
Ravindra Picture
54 Posts
back to top
  Rated 0 | Posted 30-03-2009

I guess Log4j is the most common logging API and easy to configure. You may go with it. All you need it log4j.properties file and log4j.jar in your classpath. I guess WebAppClassLoader (putting jar and property file in WEB-INF/lib doesn't work) is not able to load log4j.jar, you need to put it in classpath (not sure but if i remember correctly, I had this problem too).

Vipin
Vipin Picture
28 Posts
back to top
  Rated 0 | Posted 07-04-2009

I guess Log4j is the most common logging API and e... See Ravindra's complete reply


Putting log4j.jar in lib directory working fine, we need to take care about log4j.properties, it should be in class path.

0
Vote Vote
Share  
 Type: Professional, please report if fun topic

Recent Activity in Forums

05-04-2012.
05-04-2012.
Kanchana posted a new forum topic in
27-02-2012.
11-02-2012.
Kanchana posted a new forum topic in
11-02-2012.