Search in sources :

Example 31 with LoggerContext

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

the class CeProcessLoggingTest method sql_logger_level_changes_with_ce_property_and_is_case_insensitive.

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

Example 32 with LoggerContext

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

the class CeProcessLoggingTest method configure_defines_hardcoded_levels_unchanged_by_global_property.

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

Example 33 with LoggerContext

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

the class CeProcessLoggingTest method sql_logger_level_changes_with_global_property_and_is_case_insensitive.

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

Example 34 with LoggerContext

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

the class CeProcessLoggingTest method jmx_logger_level_changes_with_ce_jmx_property_and_is_case_insensitive.

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

Example 35 with LoggerContext

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

the class WebServerProcessLoggingTest method sql_logger_level_is_configured_from_web_sql_property_over_global_property.

@Test
public void sql_logger_level_is_configured_from_web_sql_property_over_global_property() {
    props.set("sonar.log.level.web.sql", "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)

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