Logback: do I rebuild logback for custom layouts? -
i created custom layout (as shown in chapter 6: layouts, http://logback.qos.ch/manual/layouts.html), have patch logback, or there configurable way let logback knows custom layout class?
thank you.
you can reference layout in logback.xml using full namespace of custom layout. if layout @ com.mydomain.logback.layouts.mycustomlayout
in logback.xml, you'd have appender definition looks this:
<appender name="stdout" class="ch.qos.logback.core.consoleappender"> <layout class="com.mydomain.logback.layouts.mycustomlayout" /> </appender>
now every time log event gets passed through stdout appender, processed custom appender. no need recompile logback.
Comments
Post a Comment