File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with Log4j

 
Raj kumar
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I pass the error statements to a file and debug statements to the console using log4j?


Thanks
Raj
 
emm raha
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic