[logback-user] Sane solution for centralised logging with logback

Michael McCarthy mikeycmccarthy at gmail.com
Wed Feb 29 13:08:48 CET 2012

Hi all,

Just working on a solution for centralised logging in our development
environment, and it would be good to get some feedback.

The solution until this morning was this:

- Developers build apps with their own logback.xml inside
- These get deployed to jboss. A system property for the logback file kicks
in, and the logback file on jboss takes precedence over the application
one. This logback file has a gelf appender, and all logging is done

This works perfectly, logback is working well, logback-gelf is working well

The only problem with it is once more applications are deployed. When
looking at logs we suddenly have no idea which app a log is coming from.

The change of plan would be to use the contextName. What I was thinking was
that the war files get stripped at deploy time, their logback files removed
and replaced with a generic one (that has the gelf stuff). This logback
config would have a contextName which would be written to on the fly. The
war would then get re-assembled and deployed.

Any feedback appreciated, the basic goals are that all applications should
be logging the exact same way, centrally, and that is should be possible to
distinguish which app a log has come from given that multiple apps can be
deployed to the same app server.

Many thanks :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120229/5f58e788/attachment.html>

More information about the Logback-user mailing list