<?xml version="1.0" encoding="UTF-8"?>
<Configuration>

    <Appenders>
        <Console name="console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d %-5p %c{1} - %m%n"/>
        </Console>
        <Console name="login-appender" target="SYSTEM_OUT">
            <PatternLayout pattern="%d %-5p %c{1} - %m%n"/>
        </Console>
        <!-- Alternative login audit appender example
        <File name="login-appender" fileName="/var/log/keybox-login-audit.log" append="true">
           <PatternLayout pattern="%d %-5p %c{1} - %m%n"/>
        </File>
        -->
        <!-- System audit example using logstash
        <Socket name="logstash-socket-appender" host="127.0.0.1" port="5300">
            <SerializedLayout/>
        </Socket>
        -->
    </Appenders>

    <Loggers>
        <!-- System audit example using logstash
        <Logger name="com.keybox.manage.util.SystemAudit" level="info">
            <AppenderRef ref="logstash-socket-appender"/>
        </Logger>
        -->
        <Logger name="com.keybox.manage.action.LoginAudit" level="info">
            <AppenderRef ref="login-appender"/>
        </Logger>
        <Root level="warn">
            <AppenderRef ref="console"/>
        </Root>
    </Loggers>

</Configuration>
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>

    <Appenders>
        <Console name="console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d %-5p %c{1} - %m%n"/>
        </Console>
        <Console name="login-appender" target="SYSTEM_OUT">
            <PatternLayout pattern="%d %-5p %c{1} - %m%n"/>
        </Console>
        <!-- Alternative login audit appender example
        <File name="login-appender" fileName="/var/log/keybox-login-audit.log" append="true">
           <PatternLayout pattern="%d %-5p %c{1} - %m%n"/>
        </File>
        -->
        <!-- System audit example using logstash
        <Socket name="logstash-socket-appender" host="127.0.0.1" port="5300">
            <SerializedLayout/>
        </Socket>
        -->
    </Appenders>

    <Loggers>
        <!-- System audit example using logstash
        <Logger name="com.keybox.manage.util.SystemAudit" level="info" additivity="false">
            <AppenderRef ref="logstash-socket-appender"/>
        </Logger>
        -->
        <Logger name="com.keybox.manage.action.LoginAudit" level="info" additivity="false">
            <AppenderRef ref="login-appender"/>
        </Logger>
        <Root level="warn">
            <AppenderRef ref="console"/>
        </Root>
    </Loggers>

</Configuration>
Set additivity to false Set additivity to false to avoid duplicate logs in console
Set additivity to false
Set additivity to false to avoid duplicate logs in console
