[logback-user] Customize how some objects are "printed"
gervais.b at gmail.com
Tue Jun 19 13:47:50 CEST 2012
We are used to log the current user. But the current user is a complex
object with a ugly "toString()" who print many unuseful informations with
new lines. And, of course, we can't override that.
To have clean logs, we have to walk into the user object structure until
relevant informations and deal with many possibles null pointers.
My question is : Is it a way to register something usable by SLF4J to
render an object to a String ?
Something like :
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
*<renderer class="com.our.company.logging.UserContextRenderer" **/>*
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Logback-user