Re: File Watchdogs
>> So, if I understand this correctly, I would need to do something like: >> Logger logger = Logger.get( "logger" ); >> ComponentBase comp = new ComponentBase(); >> comp.setLoggerRepository ( logger.getLoggerRepository()); >> >> ??? That just doesn't seem right. Seems like I should need to get the >> ComponentBase from somewhere, but not quite sure from where >> > > FileWatchdog indirectly extends ComponentBase, you would need to call its > setLoggerRepository method. > > FileWatchdog confiFileWatchdog = new FileWatchdog(); > configFileWatchdog.setFile( log4j_xml_path ); > configFileWatchdog.setLoggerRepository(LogManager.getLoggerRepository ()); > configFileWatchdog.activateOptions(); Ahhh - new I was missing something obvious. Thanks. Works like a charm. >> >> I had no idea that 1.3 was geared to be discontinued altogether. Should >> I >> be abandoning 1.3 completely and revert to 1.2? I see there is still >> active >> dev on 1.3, however, so I am confused. Has there been any dev done on >> 2.0 >> at all? > log4j 2.0 development is in its infancy. The enhanced pattern layout > component prepared from log4j 1.3 sources for log4j 1.2 is being hacked > to flesh out log4j 2.0 concepts and interfaces, but it is not yet > functional. > > Ceki Gulcu who was the prime mover in the log4j 1.3 development has a > competing log framework, logBACK (http://logback.qos.ch/), that is likely > what log4j 1.3 would have become but unshackled from any compatibility > expectations with log4j 1.2. If you really want something log4j 1.3 like > and don't care about log4j 1.2 compatibility, it may be an option. I don't think I need anything critical from 1.3 anymore, so maybe just a rollback to 1.2 will be the best. Thanks again for the help! Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DailyRollingFileAppender for multiple threads
Search the archives. One file per thread has been discussed and I think someone made an appender that does it. On 5/14/07, rovelgoenne <[EMAIL PROTECTED]> wrote: I start multiple threads where every thread should log to his own file. Therefor I did: - every thread has a number - for every thread I get a logger with "name" + number - in every logger I add an DailyRollingFileAppender - in the thread I log to the connected logger So everything works fine. Every thread logs to his file. Code (initialization): DailyRollingFileAppender fileAppender; for ( int i = 0; i < multiplicity; i++ ) { fileAppender = new DailyRollingFileAppender( layout, "c:/log/temp" + i + ".log" "'.'-MM-dd" ); Logger logger = Logger.getLogger( "logger" + i ); logger.addAppender( fileAppender ); } There is only a problem in heavy logging in all threads. In this situation sometimes logging entries (or parts of it) from one thread show up in the logging file of another thread. Has someone an idea about the reason of such an behavour? Is my solution not suitable for such a problem? Do I have to use a different appender (because of the amount of logging entries I have to use something like DailyRollingFileAppender)? I searched the hole mailing list for an answer but I didn't found something about these exact problem. -- View this message in context: http://www.nabble.com/DailyRollingFileAppender-for-multiple-threads-tf3752882.html#a10605350 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James Staufferhttp://www.geocities.com/stauffer_james/ Are you good? Take the test at http://www.livingwaters.com/good/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DailyRollingFileAppender for multiple threads
I start multiple threads where every thread should log to his own file. Therefor I did: - every thread has a number - for every thread I get a logger with "name" + number - in every logger I add an DailyRollingFileAppender - in the thread I log to the connected logger So everything works fine. Every thread logs to his file. Code (initialization): DailyRollingFileAppender fileAppender; for ( int i = 0; i < multiplicity; i++ ) { fileAppender = new DailyRollingFileAppender( layout, "c:/log/temp" + i + ".log" "'.'-MM-dd" ); Logger logger = Logger.getLogger( "logger" + i ); logger.addAppender( fileAppender ); } There is only a problem in heavy logging in all threads. In this situation sometimes logging entries (or parts of it) from one thread show up in the logging file of another thread. Has someone an idea about the reason of such an behavour? Is my solution not suitable for such a problem? Do I have to use a different appender (because of the amount of logging entries I have to use something like DailyRollingFileAppender)? I searched the hole mailing list for an answer but I didn't found something about these exact problem. -- View this message in context: http://www.nabble.com/DailyRollingFileAppender-for-multiple-threads-tf3752882.html#a10605350 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]