Search in sources :

Example 41 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_ce_property.

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

Example 42 with LoggerContext

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

the class CeProcessLoggingTest method configure_defines_hardcoded_levels_unchanged_by_ce_property.

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

Example 43 with LoggerContext

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

the class CeProcessLoggingTest method sql_logger_level_defaults_to_INFO_if_ce_sql_property_has_invalid_value.

@Test
public void sql_logger_level_defaults_to_INFO_if_ce_sql_property_has_invalid_value() {
    props.set("sonar.log.level.ce.sql", "DodoDouh!");
    LoggerContext ctx = underTest.configure(props);
    verifySqlLogLevel(ctx, Level.INFO);
}
Also used : LoggerContext(ch.qos.logback.classic.LoggerContext) Test(org.junit.Test)

Example 44 with LoggerContext

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

the class CeProcessLoggingTest method configure_defines_hardcoded_levels.

@Test
public void configure_defines_hardcoded_levels() {
    LoggerContext context = underTest.configure(props);
    verifyImmutableLogLevels(context);
}
Also used : LoggerContext(ch.qos.logback.classic.LoggerContext) Test(org.junit.Test)

Example 45 with LoggerContext

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

the class CeProcessLoggingTest method root_logger_level_changes_with_ce_property_and_is_case_insensitive.

@Test
public void root_logger_level_changes_with_ce_property_and_is_case_insensitive() {
    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)214 Test (org.junit.Test)134 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)41 Logger (ch.qos.logback.classic.Logger)39 PatternLayoutEncoder (ch.qos.logback.classic.encoder.PatternLayoutEncoder)24 FileAppender (ch.qos.logback.core.FileAppender)21 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 JoranException (ch.qos.logback.core.joran.spi.JoranException)14 NullLevelFilterFactory (io.dropwizard.logging.filter.NullLevelFilterFactory)13 ConsoleAppender (ch.qos.logback.core.ConsoleAppender)12 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