This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Websphere and the fly likes Help with Log4j Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Help with Log4j" Watch "Help with Log4j" New topic
Author

Help with Log4j

Raj kumar
Greenhorn

Joined: Jan 06, 2005
Posts: 15
How can I pass the error statements to a file and debug statements to the console using log4j?


Thanks
Raj
emm raha
Ranch Hand

Joined: Mar 18, 2003
Posts: 57
instantiate 2 loggers:


and create appenders for each in log4j.properties:


n.b. txt_debugs will log everything of DEBUG priority and higher (including ERRORs), therefore messages may be duplicated.

BTW - this should probably be in "Other Open Source Projects".
 
 
subject: Help with Log4j
 
Similar Threads
how to log errors occurred in backend java engine or servlet
Debugging Best Practices??
error when i run log file
porb. with log4j
Log4J with System.out.prinltn