79690130

Date: 2025-07-04 11:44:28
Score: 2
Natty:
Report link

I have found the following works:

  <rules>         
      <logger name="*" minlevel="Info" writeTo="logfile" />     
      <logger name="*" minlevel="Trace" maxLevel="Debug" writeTo="logfile" >
          <filters defaultAction="Ignore">
              <when condition="'${event-properties:item=Category}' == 'MyCategory'" action="Log" />           
          </filters>
      </logger>   
  </rules>

However, it feels very clunky, especially having to restrict the categories with a maxLevel to prevent duplication, so I'm sure there must be a better way?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Campbell