wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Log4j Property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Log4j Property" Watch "Log4j Property" New topic
Author

Log4j Property

Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130
Hello

I am introducing log4j in my application and succeeded to do so. But now I want to saperate the log in different file according to their LEVEL i.e.

debug log should go in debug.log file and
warn log should go in warn.log file and
similarly other error and info and fatal.

Please help me in the regard.

Thankyou
Syed Saifuddin
Java Developer


Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
http://www.socialinet.com
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Create 3 file appenders in your log4j config file.

Example:
debugAppender
warnAppender
errorAppender

Then you can set the appender you want to use. Example:
private static final Logger LOG = Logger.getLogger("warnAppender");
LOG.warn("An exception was thrown");
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log4j Property
 
Similar Threads
Deploy Java Web Application on Linux Environment using JBoss Application Server
Not able to save logs into .log file
Can Log4j read two properties?
error when i run log file
Create user wise Log file.