This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

seperate log files based on a unique identifier

 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you guys happen to know how I can configure log4J to write to different log files which will contain a unique identifier(not a date) that is present within the code block during the time of writing?
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ronnie,

You can write log files in what ever manner you want. You can append unique identifier also in log file name. What you need to do is to write custom file appender. You need to define that custom file appender class name in the log4j.xml file. In this way you can get whatever you want.

Search on google, you will get samples how to write custom file appender for log4j.

Regards,
Sunil
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic