multiple threads requiring a separate log file
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   paul_french
Posted On:   Monday, April 4, 2005 02:21 PM

I have a master thread. This thread kicks off a configured number of slave threads. Each slave thread needs the exact same type of logger but each FileAppender logs to a separate file. Any pointers on an appreoach would be great!

Re: multiple threads requiring a separate log file

Posted By:   Zac_Jacobson  
Posted On:   Monday, April 4, 2005 03:26 PM

At first consideration, my suggestions would be:

Give your threads names and append .threadName onto the logger name you're getting.

If you know how many threads you're going to have and what their names will be, you can configure a separate logger for each in log4j.properties.

If you don't know how may threads you're going to have, you might consider extending the FileAppender so that it will incorporate the logger name (which you're putting your Threads' names in) into the filename.

Hope those ideas help,
Zac

About | Sitemap | Contact