Very often I want to exclude logging from a specific chatty logger up to a certain level. Unfortunately, the first of the following rules is final for all levels of that logger, so that the second rule (which is simply my default rule) will not log anything from it:
<logger name="ChattyLogger" maxlevel="Warn" writeTo="blackhole" final="true" />
<logger name="*" minlevel="Info" writeTo="default" />
One possibility is to use filters instead:
<logger name="ChattyLogger" writeTo="blackhole">
<filters>
<when condition="level<=LogLevel.Warn" action="IgnoreFinal" />
</filters>
</logger>
<logger name="*" minlevel="Info" writeTo="default" />
But the syntax is ugly, especially the length and the need to escape the condition expression.
Since this seems like such a common requirement, I'm wondering if I overlooked something.
I'm using nlog under Silverlight, but I presume that shouldn't matter.
(I've posted the same question on StackOverflow here, but without answers so far.)
Hi,
Actually thought I've answered this on SO, but apparently not :-)
Currently there are no other way than using filters.
--
You received this message because you are subscribed to the Google Groups "NLog-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nlog-users+...@googlegroups.com.
To post to this group, send email to nlog-...@googlegroups.com.
Visit this group at http://groups.google.com/group/nlog-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
I just thought of something, I'll have to check out our first.