Search in sources :

Example 86 with Appender

use of ch.qos.logback.core.Appender in project atlasdb by palantir.

the class ProfilingKeyValueServiceTest method getSlowLogPresentOnInfoLevel.

@Test
public void getSlowLogPresentOnInfoLevel() {
    Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);
    doAnswer(waitASecondAndAHalfAndReturn).when(delegate).get(TABLE_REF, timestampByCell);
    kvs.get(TABLE_REF, timestampByCell);
    verify(mockAppender).doAppend(slowLogMatcher.get());
}
Also used : Appender(ch.qos.logback.core.Appender) Test(org.junit.Test)

Example 87 with Appender

use of ch.qos.logback.core.Appender in project atlasdb by palantir.

the class ProfilingKeyValueServiceTest method getAllTableNamesSlowLogPresentOnInfoLevel.

@Test
public void getAllTableNamesSlowLogPresentOnInfoLevel() {
    Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);
    doAnswer(waitASecondAndAHalf).when(delegate).getAllTableNames();
    kvs.getAllTableNames();
    verify(mockAppender).doAppend(slowLogMatcher.get());
}
Also used : Appender(ch.qos.logback.core.Appender) Test(org.junit.Test)

Example 88 with Appender

use of ch.qos.logback.core.Appender in project atlasdb by palantir.

the class ProfilingKeyValueServiceTest method getNoLoggingHappensIfQueryFastAndInfoLevel.

@Test
public void getNoLoggingHappensIfQueryFastAndInfoLevel() {
    Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);
    kvs.get(TABLE_REF, timestampByCell);
    verifyNoMoreInteractions(mockAppender);
}
Also used : Appender(ch.qos.logback.core.Appender) Test(org.junit.Test)

Example 89 with Appender

use of ch.qos.logback.core.Appender in project atlasdb by palantir.

the class ProfilingKeyValueServiceTest method getAllTableNamesTraceLogPresentOnTraceLevelEvenIfQueryIsSlow.

@Test
public void getAllTableNamesTraceLogPresentOnTraceLevelEvenIfQueryIsSlow() {
    Appender mockAppender = setLogLevelAndGetAppender(Level.TRACE);
    doAnswer(waitASecondAndAHalf).when(delegate).getAllTableNames();
    kvs.getAllTableNames();
    verify(mockAppender).doAppend(traceLogMatcher.get());
    verify(mockAppender).doAppend(slowLogMatcher.get());
}
Also used : Appender(ch.qos.logback.core.Appender) Test(org.junit.Test)

Example 90 with Appender

use of ch.qos.logback.core.Appender in project atlasdb by palantir.

the class ProfilingKeyValueServiceTest method getAllTableNamesNoLoggingHappensIfQueryFastAndInfoLevel.

@Test
public void getAllTableNamesNoLoggingHappensIfQueryFastAndInfoLevel() {
    Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);
    kvs.getAllTableNames();
    verifyNoMoreInteractions(mockAppender);
}
Also used : Appender(ch.qos.logback.core.Appender) Test(org.junit.Test)

Aggregations

Appender (ch.qos.logback.core.Appender)118 Test (org.junit.Test)62 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)51 Logger (ch.qos.logback.classic.Logger)32 LoggerContext (ch.qos.logback.classic.LoggerContext)32 FileAppender (ch.qos.logback.core.FileAppender)27 Logger (org.slf4j.Logger)25 ConsoleAppender (ch.qos.logback.core.ConsoleAppender)21 ArgumentMatcher (org.mockito.ArgumentMatcher)19 AsyncAppender (ch.qos.logback.classic.AsyncAppender)18 File (java.io.File)14 OnMarkerEvaluator (ch.qos.logback.classic.boolex.OnMarkerEvaluator)13 EvaluatorFilter (ch.qos.logback.core.filter.EvaluatorFilter)13 LogstashTcpSocketAppender (net.logstash.logback.appender.LogstashTcpSocketAppender)13 ArrayList (java.util.ArrayList)11 ApplicationService (org.codice.ddf.admin.application.service.ApplicationService)11 OutputStreamAppender (ch.qos.logback.core.OutputStreamAppender)10 RollingFileAppender (ch.qos.logback.core.rolling.RollingFileAppender)9 DBAppender (ch.qos.logback.classic.db.DBAppender)8 Test (org.junit.jupiter.api.Test)7