[logback-user] additional informations for appenders?

Lars Fischer reschifl at googlemail.com
Wed Sep 21 15:09:09 CEST 2011


Hello,

I would like to use slf4j together with logback as logging framework.
But I have some special requirements, which I'm not happy with them,
but I can not drop them.

1) I need to transfer additional informations with each request to the appender.

E.g. a thing like a "logDocumentId". Furthermore, I need to have
multiple of such Ids active in one session/thread.
I have to give the id int each request and an own appender
implementation has to do something with it.

What would be the best way to carry such Id besides the standard log
message and parameters throug the slf4j api to the logback appenders?

Can I store such objects in the MDC? How does this affect the
performance, when used on every log request?

Or would it be better to add the informations as additional elements
at the end of the "argArray" parameter of the Logger methods, hoping
that all appenders will ignore them, when there is no "{}" for the
position?


2) I know that logback can be reconfigured on runtime, but all I know
is that during this re-configuration, all log-requests will be droped.

Is there a way to only add / remove / change a single TurboFilter or
Appender without losing processing of requests by the "normal" loggers
/ appenders?



Best regards,
Lars


More information about the Logback-user mailing list