private static Appender < ILoggingEvent > getStdErrAppender ( final LoggerContext context , final ReplaceNewLines replaceNewLines ) { // Setup format final PatternLayoutEncoder encoder = new PatternLayoutEncoder ( ) ; encoder . setContext ( context ) ; encoder . setPattern ( "%date{HH:mm:ss.SSS} %property{ident}[%property{pid}]: %-5level [%thread] %logger{0}: " + ReplaceNewLines . getMsgPattern ( replaceNewLines ) + "%n" ) ; encoder . setCharset ( Charsets . UTF_8 ) ; encoder . start ( ) ; // Setup stderr appender final ConsoleAppender < ILoggingEvent > appender = new ConsoleAppender < ILoggingEvent > ( ) ; appender . setTarget ( "System.err" ) ; appender . setName ( "stderr" ) ; appender . setEncoder ( encoder ) ; appender . setContext ( context ) ; appender . start ( ) ; return appender ; }
Create a stderr appender .