ccleve
ccleve

Reputation: 15779

Suppressing Logback output, again

How do I suppress all of Logback's initial output? This question has been asked twice before, but my situation is a little different; Logback isn't throwing any warnings or errors.

Here's the entire log:

17:29:32,471 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - Ignoring debug attribute.
17:29:32,472 |-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Adding status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener]
17:29:32,473 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
17:29:32,473 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
17:29:32,474 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
17:29:32,474 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern C:/dev/diesel/trunk/diesel-test//logs/request/request-%d{yyyy-MM-dd}.log for the active file
17:29:32,475 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'C:/dev/diesel/trunk/diesel-test//logs/request/request-%d{yyyy-MM-dd}.log'.
17:29:32,475 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
17:29:32,475 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Wed Jun 13 17:29:32 CDT 2012
17:29:32,475 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.access.PatternLayoutEncoder] for [encoder] property
17:29:32,497 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: C:/dev/diesel/trunk/diesel-test//logs/request/request-2012-06-13.log
17:29:32,497 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [null]
17:29:32,498 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to ch.qos.logback.access.jetty.v7.RequestLogImpl@3caa4b
17:29:32,498 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - End of configuration.
17:29:32,499 |-INFO in ch.qos.logback.access.jetty.v7.RequestLogImpl@3caa4b - RequestLog added to RequestLogRegistry with name: LogbackRequestLog

And here's logback.xml. Note that I set root level=OFF for testing.

<configuration>

    <property name="MAIN_LOG_DIR" value="${app.home}/logs"/>
    <property name="DEFAULT_ENCODER_PATTERN" value="%date{yyyy-MM-dd HH:mm:ss} %logger %-4relative %-5level %msg%n" />
    <property name="DEFAULT_FILENAME_PATTERN" value="-%d{yyyy-MM-dd}.log" />

    <logger name="org.quartz" additivity="false">
        <appender class="ch.qos.logback.core.helpers.NOPAppender"></appender>   
    </logger>

    <root level="OFF">
        <appender class="ch.qos.logback.core.rolling.RollingFileAppender">
            <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                <fileNamePattern>${MAIN_LOG_DIR}/root/root${DEFAULT_FILENAME_PATTERN}</fileNamePattern>
            </rollingPolicy>
            <encoder><pattern>${DEFAULT_ENCODER_PATTERN}</pattern></encoder>
        </appender> 
    </root>

</configuration>

I also have a separate logback-access.xml, which I'll post if someone wants to see it.

Upvotes: 0

Views: 2212

Answers (1)

Ceki
Ceki

Reputation: 27435

The status messages you see are output by logback-access not logback-classic.

The first line is the give away (there are other indications as well)

|-INFO in ch.qos.logback.**access**.joran.action.ConfigurationAction - Ignoring debug attribute.

Logback-access outputs its internal status on the console because apparently it has been asked to do so:

|-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Adding status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener]

For logback-access, the configuration file is named logback-access.xml. You should post the contents of that file, not logback.xml.

Upvotes: 1

Related Questions