This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with Log4j  RSS feed

 
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
Boost this thread!