
That makes sense, thanks. Is there a way though for multiple web apps to use a single common appender within a Tomcat instance? Regards, Aleksander Kamenik On Fri, Mar 24, 2017 at 12:20 PM, Ceki Gülcü <ceki@qos.ch> wrote:
As soon as multiple FileAppender instances write to the same file, prudent mode is mandatory. The fact that the FileAppender instances reside in the same JVM is totally irrelevant.
On 3/24/2017 10:43, Aleksander Kamenik wrote:
Hi!
I'm having trouble with several web apps logging to a single rolling file appender in one JVM (Tomcat 8.0) without prudent mode. I've tried several setups with logback.xml configurations however no matter what I do I get apps overwriting already rolled over files.
For testing I've set rollover to each minute and getting apps to overwrite already rolled over files is trivial. Reading the manual though I understand this should work just fine provided all the apps are using the same JVM and therefore the same appender.
This does not seem to be the case though. During startup I see each app log "AppenderAction - Naming appender as [COMMON]" for example. I presume this means every app creates their own appender instead of reusing the existing one.
The slf4j and logback jar files are located in tomcat's lib directory as is the logback.xml file. I've tried context based log separation too with shared logback.xml as well as per app logback.xml but the result for shared appender is always the same.
I have a feeling I'm missing something obvious and important here.
Regards,
_______________________________________________ logback-user mailing list logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
-- Aleksander Kamenik