Search in sources :

Example 6 with SyslogAppender

use of ch.qos.logback.classic.net.SyslogAppender in project qpid-broker-j by apache.

the class BrokerSyslogLoggerImpl method createAppenderInstance.

@Override
protected Appender<ILoggingEvent> createAppenderInstance(Context context) {
    SyslogAppender syslogAppender = new SyslogAppender();
    syslogAppender.setSyslogHost(_syslogHost);
    syslogAppender.setPort(_port);
    syslogAppender.setSuffixPattern(_suffixPattern);
    syslogAppender.setStackTracePattern(_stackTracePattern);
    syslogAppender.setThrowableExcluded(_throwableExcluded);
    syslogAppender.setFacility("USER");
    return syslogAppender;
}
Also used : SyslogAppender(ch.qos.logback.classic.net.SyslogAppender)

Example 7 with SyslogAppender

use of ch.qos.logback.classic.net.SyslogAppender in project qpid-broker-j by apache.

the class VirtualHostSyslogLoggerImpl method createAppenderInstance.

@Override
protected Appender<ILoggingEvent> createAppenderInstance(Context context) {
    SyslogAppender syslogAppender = new SyslogAppender();
    syslogAppender.setSyslogHost(_syslogHost);
    syslogAppender.setPort(_port);
    syslogAppender.setSuffixPattern(_suffixPattern);
    syslogAppender.setStackTracePattern(_stackTracePattern);
    syslogAppender.setThrowableExcluded(_throwableExcluded);
    syslogAppender.setFacility("USER");
    return syslogAppender;
}
Also used : SyslogAppender(ch.qos.logback.classic.net.SyslogAppender)

Example 8 with SyslogAppender

use of ch.qos.logback.classic.net.SyslogAppender in project dropwizard by dropwizard.

the class SyslogAppenderFactoryTest method patternIncludesAppNameAndPid.

@Test
public void patternIncludesAppNameAndPid() throws Exception {
    final AsyncAppender wrapper = (AsyncAppender) new SyslogAppenderFactory().build(new LoggerContext(), "MyApplication", new DropwizardLayoutFactory(), new NullLevelFilterFactory<>(), new AsyncLoggingEventAppenderFactory());
    assertThat(((SyslogAppender) wrapper.getAppender("syslog-appender")).getSuffixPattern()).matches("^MyApplication\\[\\d+\\].+");
}
Also used : AsyncLoggingEventAppenderFactory(io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory) AsyncAppender(ch.qos.logback.classic.AsyncAppender) NullLevelFilterFactory(io.dropwizard.logging.filter.NullLevelFilterFactory) SyslogAppender(ch.qos.logback.classic.net.SyslogAppender) DropwizardLayoutFactory(io.dropwizard.logging.layout.DropwizardLayoutFactory) LoggerContext(ch.qos.logback.classic.LoggerContext) Test(org.junit.Test)

Aggregations

SyslogAppender (ch.qos.logback.classic.net.SyslogAppender)8 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)3 Appender (ch.qos.logback.core.Appender)3 AsyncAppender (ch.qos.logback.classic.AsyncAppender)2 Logger (ch.qos.logback.classic.Logger)2 LoggerContext (ch.qos.logback.classic.LoggerContext)2 ConsoleAppender (ch.qos.logback.core.ConsoleAppender)2 FileAppender (ch.qos.logback.core.FileAppender)2 OutputStreamAppender (ch.qos.logback.core.OutputStreamAppender)2 AsyncLoggingEventAppenderFactory (io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory)2 NullLevelFilterFactory (io.dropwizard.logging.filter.NullLevelFilterFactory)2 DropwizardLayoutFactory (io.dropwizard.logging.layout.DropwizardLayoutFactory)2 UnknownHostException (java.net.UnknownHostException)2 Test (org.junit.Test)2 PatternLayoutEncoder (ch.qos.logback.classic.encoder.PatternLayoutEncoder)1 JoranConfigurator (ch.qos.logback.classic.joran.JoranConfigurator)1 JoranException (ch.qos.logback.core.joran.spi.JoranException)1 DiscoverableSubtypeResolver (io.dropwizard.jackson.DiscoverableSubtypeResolver)1 File (java.io.File)1 HashMap (java.util.HashMap)1