use of ch.qos.logback.classic.encoder.PatternLayoutEncoder in project jmxtrans by jmxtrans.
the class KeyOutWriter method buildEncoder.
protected Encoder buildEncoder() {
PatternLayoutEncoder encoder = new PatternLayoutEncoder();
encoder.setContext(loggerContext);
encoder.setPattern(logPattern);
encoder.start();
return encoder;
}
use of ch.qos.logback.classic.encoder.PatternLayoutEncoder in project TOSCAna by StuPro-TOSCAna.
the class PersistentAppender method setupLayout.
private void setupLayout(LoggerContext lc) {
PatternLayoutEncoder ple = new PatternLayoutEncoder();
ple.setPattern(PATTERN_LAYOUT);
ple.setContext(lc);
ple.start();
setEncoder(ple);
}
use of ch.qos.logback.classic.encoder.PatternLayoutEncoder in project hub-detect by blackducksoftware.
the class DiagnosticLogger method addAppender.
private FileAppender<ILoggingEvent> addAppender(final String file) {
final LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
final PatternLayoutEncoder ple = new PatternLayoutEncoder();
ple.setPattern("%date %level [%file:%line] %msg%n");
ple.setContext(lc);
ple.start();
FileAppender<ILoggingEvent> appender;
appender = new FileAppender<>();
appender.setFile(file);
appender.setEncoder(ple);
appender.setContext(lc);
appender.start();
final ch.qos.logback.classic.Logger logbackLogger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(LOGBACK_LOGGER_NAME);
logbackLogger.addAppender(appender);
logbackLogger.setLevel(Level.ALL);
return appender;
}
use of ch.qos.logback.classic.encoder.PatternLayoutEncoder in project adeptj-runtime by AdeptJ.
the class LogbackManager method newLayoutEncoder.
private PatternLayoutEncoder newLayoutEncoder(String logPattern) {
PatternLayoutEncoder layoutEncoder = new PatternLayoutEncoder();
layoutEncoder.setContext(this.loggerContext);
layoutEncoder.setPattern(logPattern);
layoutEncoder.setCharset(UTF_8);
layoutEncoder.start();
return layoutEncoder;
}
Aggregations