[LOGBack-user] Unable to use RollingFileAppender
Samuel Doyle
sdoyle_2 at yahoo.com
Wed Sep 13 19:17:53 CEST 2006
Hello Sebastien,
Excellent, I will give this a try. Thanks for your response.
S.D.
Sebastien Pennec <sebastien at qos.ch> wrote: Hello Samuel,
Thanks for trying logback!
The RollingFileAppender needs a TriggeringPolicy object to know when to roll the
active output file.
In brief, a TriggeringPolicy controls the conditions under which roll-over occurs.
Such conditions include time of day, file size, an external event, the log request or
a combination thereof.
A working configuration file for a RollingFileAppender would be:
With this configuration, the file would be rolled each time it reaches 5MB.
When I look at the configuration file that you sent, something seems strange to me:
Why do you configure two Loggers with the same Appender and one of them with the
Additivity flag set to false? One would obtain the same result simply by attaching
the RollingFileAppender to the root logger.
Hope this helps you get on track with logback. Do not hesitate to write again if you
run into trouble.
Sébastien
--
Sébastien Pennec
sebastien at qos.ch
Logback: The reliable, generic, fast and flexible logging framework for Java.
Samuel Doyle a écrit :
> Hello,
>
> I'm new to logback but read your documentation, I an not receiving any
> output to my logfile. Here is my configuration file, following this is
> the output from logback to the console. The only thing I notice is a
> warning about a TriggerPolicy. If this is the case do you have example
> syntax?
> ---
>
>
>
>
>
>
> class="ch.qos.logback.core.rolling.RollingFileAppender">
>
>
>
>
>
>
>
>
>
>
> additivity="false">
>
>
>
>
>
>
>
>
>
>
>
> ---
> Here is console output when using LoggerStatusPrinter:
> ---
>
> startElement [configuration]
> startElement [appender]
> startElement [param]
> startElement [param]
> LOGBACK: No context given for ch.qos.logback.core.util.PropertySetter at 8c5ea2
> startElement [param]
> startElement [param]
> LOGBACK: No context given for
> ch.qos.logback.core.util.PropertySetter at 198defc
> startElement [layout]
> startElement [param]
> startElement [logger]
> startElement [level]
> startElement [appender-ref]
> startElement [root]
> startElement [level]
> startElement [appender-ref]
> INFO in ch.qos.logback.classic.joran.action.ConfigurationAction -
> Ignoring debug attribute.
> INFO in ch.qos.logback.core.joran.action.AppenderAction - About to
> instantiate appender of type [ch
> .qos.logback.core.rolling.RollingFileAppender]
> INFO in ch.qos.logback.core.joran.action.AppenderAction - Appender named
> as [bitranlog]
> WARN in ch.qos.logback.core.rolling.RollingFileAppender[bitranlog] -
> Please set a TriggeringPolicy
> for the RollingFileAppender named bitranlog
> INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping
> appender named [bitranlog] from t
> he object stack
> INFO in ch.qos.logback.classic.joran.action.LevelAction -
> org.accma.concentrator.services.bitran.Bi
> TranService level set to DEBUG
> INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching
> appender named [bitranlog to
> Logger[org.accma.concentrator.services.bitran.BiTranService]
> INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set
> to DEBUG
> INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching
> appender named [bitranlog to
> Logger[root]
>
>
> Thanks, S.D.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
_______________________________________________
Logback-user mailing list
Logback-user at qos.ch
http://qos.ch/mailman/listinfo/logback-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://qos.ch/pipermail/logback-user/attachments/20060913/1092c179/attachment.htm
More information about the Logback-user
mailing list