This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with Log4j

 
Raj kumar
Greenhorn
Posts: 15
  • 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
  • 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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic