Search in sources :

Example 46 with LoggerContext

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

the class CeProcessLoggingTest method default_level_for_root_logger_is_INFO.

@Test
public void default_level_for_root_logger_is_INFO() {
    LoggerContext ctx = underTest.configure(props);
    verifyRootLogLevel(ctx, Level.INFO);
}
Also used : LoggerContext(ch.qos.logback.classic.LoggerContext) Test(org.junit.Test)

Example 47 with LoggerContext

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

the class CeProcessLoggingTest method es_logger_level_changes_with_ce_property_and_is_case_insensitive.

@Test
public void es_logger_level_changes_with_ce_property_and_is_case_insensitive() {
    props.set("sonar.log.level.ce", "TrACe");
    LoggerContext ctx = underTest.configure(props);
    verifyEsLogLevel(ctx, Level.TRACE);
}
Also used : LoggerContext(ch.qos.logback.classic.LoggerContext) Test(org.junit.Test)

Example 48 with LoggerContext

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

the class CeProcessLoggingTest method sql_logger_level_is_configured_from_ce_property_over_global_property.

@Test
public void sql_logger_level_is_configured_from_ce_property_over_global_property() {
    props.set("sonar.log.level.ce", "debug");
    props.set("sonar.log.level", "TRACE");
    LoggerContext ctx = underTest.configure(props);
    verifySqlLogLevel(ctx, Level.DEBUG);
}
Also used : LoggerContext(ch.qos.logback.classic.LoggerContext) Test(org.junit.Test)

Example 49 with LoggerContext

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

the class CeProcessLoggingTest method es_logger_level_is_configured_from_ce_es_property_over_global_property.

@Test
public void es_logger_level_is_configured_from_ce_es_property_over_global_property() {
    props.set("sonar.log.level.ce.es", "debug");
    props.set("sonar.log.level", "TRACE");
    LoggerContext ctx = underTest.configure(props);
    verifyEsLogLevel(ctx, Level.DEBUG);
}
Also used : LoggerContext(ch.qos.logback.classic.LoggerContext) Test(org.junit.Test)

Example 50 with LoggerContext

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

the class CeProcessLoggingTest method root_logger_level_is_configured_from_ce_property_over_global_property.

@Test
public void root_logger_level_is_configured_from_ce_property_over_global_property() {
    props.set("sonar.log.level", "TRACE");
    props.set("sonar.log.level.ce", "DEBUG");
    LoggerContext ctx = underTest.configure(props);
    verifyRootLogLevel(ctx, Level.DEBUG);
}
Also used : LoggerContext(ch.qos.logback.classic.LoggerContext) Test(org.junit.Test)

Aggregations

LoggerContext (ch.qos.logback.classic.LoggerContext)216 Test (org.junit.Test)134 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)43 Logger (ch.qos.logback.classic.Logger)41 PatternLayoutEncoder (ch.qos.logback.classic.encoder.PatternLayoutEncoder)26 FileAppender (ch.qos.logback.core.FileAppender)22 File (java.io.File)21 JoranConfigurator (ch.qos.logback.classic.joran.JoranConfigurator)19 RollingFileAppender (ch.qos.logback.core.rolling.RollingFileAppender)16 Appender (ch.qos.logback.core.Appender)14 ConsoleAppender (ch.qos.logback.core.ConsoleAppender)14 JoranException (ch.qos.logback.core.joran.spi.JoranException)14 NullLevelFilterFactory (io.dropwizard.logging.filter.NullLevelFilterFactory)13 AsyncLoggingEventAppenderFactory (io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory)12 AsyncAppender (ch.qos.logback.classic.AsyncAppender)11 DropwizardLayoutFactory (io.dropwizard.logging.layout.DropwizardLayoutFactory)11 Logger (org.slf4j.Logger)10 IOException (java.io.IOException)8 TimeBasedRollingPolicy (ch.qos.logback.core.rolling.TimeBasedRollingPolicy)7 URL (java.net.URL)7