[logback-user] Assigning a log level to an appender
Shane Kelly
logback at ballinascreen.com
Sat Dec 15 01:55:55 CET 2012
Ralph,
Thanks for your suggestion - after a quick skim through the documentation
it certainly looks like markers may provide the behaviour I'm looking for -
will give that a try.
Regards,
Shane
On 15 December 2012 00:23, Ralph Goers <rgoers at apache.org> wrote:
>
> See http://logback.qos.ch/manual/filters.html#levelFilter
>
> Ralph
>
> On Dec 14, 2012, at 6:40 AM, Benoît Thiébault wrote:
>
> Hi everyone,
>
> I have developed a custom LogBack appender and I would like it to receive
> only log messages of a given level. I don't want to hard code it in the
> class, but to set it in the XML configuration file.
>
> I thought something like this would work (but it doesn't):
> <root level="trace">
> <appender-ref ref="FILE" />
> <appender-ref ref="MyTraceAppender" />
> <appender-ref ref="MyInfoAppender" level="info"/>
> </root>
>
> I also tried something like:
> <appender name="MyTraceAppender" class="org.test.MyLogger1"/>
> <appender name="MyInfoAppender" class="org.test.MyLogger2" level="info"/>
>
> No luck either.
>
> It seems only loggers can be assigned a threshold level. So I though about
> something like this:
> <logger name="test" level="info">
> <appender-ref ref="MyInfoAppender" />
> </logger>
>
> but this would only log messages sent by classes whose package is test.
> *... And I want to log anything.
>
> Can anyone help?
>
> Thanks
> Ben
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>
>
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20121215/9d8b2ea1/attachment-0001.html>
More information about the Logback-user
mailing list