Rule final attribute

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Rule final attribute

Diman
This post was updated on .
I have the configuration below (and last version of NLog, Net Framework 4, Win7 x86). My second and third rules never work. Why? I think, that for events with levels, other than "Trace", second rule should work.
  <targets>
    <target name="logfile" xsi:type="File" fileName="file.txt" />
    <target name="tracefile" xsi:type="File" fileName="traces.txt" />
    <target xsi:type="Console" name="cons" error="false"/>
  </targets>

  <rules>
    <logger name="*" level="Trace"  writeTo="tracefile" final="true" />
    <logger name="*" minlevel="Trace" writeTo="cons" />
    <logger name="*" minlevel="Error" writeTo="logfile" />
  </rules>

P.S. I think I begin to understand logic after I've studied example (http://nlog-project.org/wiki/Tutorial#Logger-specific_routing)
"Rule match" means "logger name match" but not "logger name and level", right?
Reply | Threaded
Open this post in threaded view
|

Re: Rule final attribute

Jason LaFlair
Administrator
From some quick code surfing there may be a 'bug' in the final logic.