[logback-user] Java programmatic configurations

Martinus Martinus martinus787 at gmail.com
Thu Jul 5 03:34:44 CEST 2012


Hi,

What is the equivalent programmatical java code for below logback.xml
configuration :

<configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder
            by default -->
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger -
%msg%n</pattern>
        </encoder>
    </appender>

    <appender name="SYSLOG"
class="ch.qos.logback.classic.net.SyslogAppender">
*        <syslogHost>myhost</syslogHost>*
*        <facility>USER</facility>*
*        <suffixPattern>[%thread] %logger *%msg</suffixPattern>
    </appender>

    <root level="debug">
        <appender-ref ref="SYSLOG"/>
        <appender-ref ref="STDOUT"/>
    </root>
</configuration>

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120705/f7a11cf5/attachment.html>


More information about the Logback-user mailing list