T
the.cagatay
Hi,
I have 5 different java applications(one has main method, others are
threads) which uses log4j for logging purpose. The mechanism which is
used for to run the programs, is
A manager application starts the other applications. Each application
has its own log4j configuration file with different names.
I put root logger descreption for every file of the applications.
The manager does not have logger.
//////////////////////////////////////////////////////////////////
<root>
<priority value="DEBUG" />
<appender-ref ref="App1Appender" />
</root>
<root>
<priority value="DEBUG" />
<appender-ref ref="App2Appender" />
</root>
<root>
<priority value="DEBUG" />
<appender-ref ref="App3Appender" />
</root>
<root>
<priority value="DEBUG" />
<appender-ref ref="App4Appender" />
</root>
//////////////////////////////////////////////////////////////////
But When I did this, App1 and App2 applications did not log. I try to
remove root logger from some of the files that only one file will have
root logger description. At this point I get the error
//////////////////////////////////////////////////////////////////
log4j: No appenders could be found for category (some.category.name).
log4j: Please initialize the log4j system properly.
//////////////////////////////////////////////////////////////////
I know I must declare root loger to solve this problem but when I put
the root logger declaration to every file, some of the loggers do not
log.
In summary, I have 5 applications which have different log4j xml
configuration file. And I want each of them to be configured according
to the given file and logs correctly.
Could you suggest something to solve this problem.
Thanks
I have 5 different java applications(one has main method, others are
threads) which uses log4j for logging purpose. The mechanism which is
used for to run the programs, is
A manager application starts the other applications. Each application
has its own log4j configuration file with different names.
I put root logger descreption for every file of the applications.
The manager does not have logger.
//////////////////////////////////////////////////////////////////
<root>
<priority value="DEBUG" />
<appender-ref ref="App1Appender" />
</root>
<root>
<priority value="DEBUG" />
<appender-ref ref="App2Appender" />
</root>
<root>
<priority value="DEBUG" />
<appender-ref ref="App3Appender" />
</root>
<root>
<priority value="DEBUG" />
<appender-ref ref="App4Appender" />
</root>
//////////////////////////////////////////////////////////////////
But When I did this, App1 and App2 applications did not log. I try to
remove root logger from some of the files that only one file will have
root logger description. At this point I get the error
//////////////////////////////////////////////////////////////////
log4j: No appenders could be found for category (some.category.name).
log4j: Please initialize the log4j system properly.
//////////////////////////////////////////////////////////////////
I know I must declare root loger to solve this problem but when I put
the root logger declaration to every file, some of the loggers do not
log.
In summary, I have 5 applications which have different log4j xml
configuration file. And I want each of them to be configured according
to the given file and logs correctly.
Could you suggest something to solve this problem.
Thanks