logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joachim Kanbach" <jo...@gmx.de>
Subject Re: How to consolidate Server and Application Logging in GlassFish?
Date Tue, 01 Mar 2016 14:31:08 GMT
I just saw some information in the Log4j documentation that makes me believe that my solution
b) would actually work, particularly if I use a separate configuration for each application
that uses a RollingFileAppender writing to the same file:

"While RolloverFileAppenders from different Configurations cannot be shared, the RollingFileManagers
can be if the Manager is accessible. For example, two web applications in a servlet container
can have their own configuration and safely write to the same file if Log4j is in a ClassLoader
that is common to both of them." (https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender)

Is my understanding correct that my proposed solution b) will not cause problems then due
to different RollingFileAppenders writing to the same file?

But how could I then achieve that there's only a single thread that takes care of the daily
log rotation (the one defined in the log4j2.xml configuration used as a system parameter for
GlassFish) without screwing all the other appenders? Could I use plain FileAppenders in the
application configurations? Or could I use RollingFileAppenders without any rotation policies

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message