Search in sources :

Example 11 with PatternLayout

use of ch.qos.logback.classic.PatternLayout in project molgenis by molgenis.

the class JobExecutionLogAppender method createLayout.

private void createLayout() {
    layout = new PatternLayout();
    layout.setPattern("%d{HH:mm:ss.SSS} - %msg%n%nopex");
    layout.setContext(getContext());
    layout.start();
}
Also used : PatternLayout(ch.qos.logback.classic.PatternLayout)

Example 12 with PatternLayout

use of ch.qos.logback.classic.PatternLayout in project coffeenet-starter by coffeenet.

the class CoffeeNetLoggingAutoConfiguration method gelfAppender.

private GelfAppender gelfAppender(LoggerContext loggerContext) {
    GelfAppender gelfAppender = new GelfAppender();
    gelfAppender.setContext(loggerContext);
    gelfAppender.setName(COFFEENET_GELF);
    gelfAppender.setServer(coffeeNetLoggingGelfProperties.getServer());
    gelfAppender.setProtocol(coffeeNetLoggingGelfProperties.getProtocol());
    gelfAppender.setPort(coffeeNetLoggingGelfProperties.getPort());
    gelfAppender.addAdditionalField("application", coffeeNetConfigurationProperties.getApplicationName());
    gelfAppender.addAdditionalField("environment", coffeeNetLoggingGelfProperties.getEnvironment());
    PatternLayout patternLayout = new PatternLayout();
    patternLayout.setContext(loggerContext);
    patternLayout.setPattern(coffeeNetLoggingGelfProperties.getLayout());
    patternLayout.start();
    gelfAppender.setLayout(patternLayout);
    gelfAppender.start();
    return gelfAppender;
}
Also used : PatternLayout(ch.qos.logback.classic.PatternLayout) GelfAppender(de.appelgriepsch.logback.GelfAppender)

Example 13 with PatternLayout

use of ch.qos.logback.classic.PatternLayout in project sonarqube by SonarSource.

the class PatternLayoutEncoder method start.

@Override
public void start() {
    PatternLayout patternLayout = new PatternLayout();
    patternLayout.getDefaultConverterMap().putAll(getEscapedMessageConverterConfig());
    patternLayout.setContext(context);
    patternLayout.setPattern(getPattern());
    patternLayout.setOutputPatternAsHeader(outputPatternAsHeader);
    patternLayout.start();
    this.layout = patternLayout;
    super.start();
}
Also used : PatternLayout(ch.qos.logback.classic.PatternLayout)

Aggregations

PatternLayout (ch.qos.logback.classic.PatternLayout)13 LoggerContext (ch.qos.logback.classic.LoggerContext)3 Logger (ch.qos.logback.classic.Logger)2 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)2 GelfAppender (de.appelgriepsch.logback.GelfAppender)2 HTMLLayout (ch.qos.logback.classic.html.HTMLLayout)1 TTLLLayout (ch.qos.logback.classic.layout.TTLLLayout)1 XMLLayout (ch.qos.logback.classic.log4j.XMLLayout)1 Appender (ch.qos.logback.core.Appender)1 ConsoleAppender (ch.qos.logback.core.ConsoleAppender)1 FileAppender (ch.qos.logback.core.FileAppender)1 LayoutWrappingEncoder (ch.qos.logback.core.encoder.LayoutWrappingEncoder)1 LogProfileInfo (com.creditease.uav.profiling.handlers.log.LogProfileInfo)1 ByteBuffer (java.nio.ByteBuffer)1 Timestamp (java.sql.Timestamp)1 HashMap (java.util.HashMap)1 Random (java.util.Random)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 Broadcaster (org.apache.jackrabbit.oak.plugins.document.persistentCache.broadcast.Broadcaster)1