Created
          February 21, 2025 21:18 
        
      - 
      
- 
        Save ramonsmits/a93365c1f7db4892b5afcaa8dcde7449 to your computer and use it in GitHub Desktop. 
    ServiceControl audit trace logging but excluding very chatty loggers
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="utf-8" ?> | |
| <!-- | |
| ServiceControl audit trace logging but excluding very chatty loggers which should use Trace/Verbose log level but | |
| that log level is not available in NServiceBus.Logging.... | |
| Also uses UTC as time reference | |
| See https://docs.particular.net/servicecontrol/logging#customize-logging | |
| --> | |
| <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| <time type="FastUTC" /> | |
| <targets async="true"> | |
| <target name="fileErrorsTarget" xsi:type="File" fileName="D:/exceptions.log" keepFileOpen="true" concurrentWrites="true" layout="${longdate:universalTime=true}|${processtime}|${threadid}|${level}|${logger}|${message}${onexception:|${exception:format=tostring}}" /> | |
| <target name="fileTraceTarget" xsi:type="File" fileName="D:/trace.log" keepFileOpen="true" concurrentWrites="true" layout="${longdate:universalTime=true}|${processtime}|${threadid}|${level}|${logger}|${message}${onexception:|${exception:format=tostring}}" /> | |
| </targets> | |
| <rules> | |
| <logger name="Microsoft.*" maxLevel="Info" final="true" /> | |
| <logger name="NServiceBus.*" maxLevel="Debug" final="true" /> | |
| <logger name="ServiceControl.Audit.Auditing.AuditIngestion" maxLevel="Debug" final="true" /> | |
| <logger name="ServiceControl.Audit.Auditing.AuditPersister" maxLevel="Debug" final="true" /> | |
| <logger name="*" minlevel="Trace" writeTo="consoleTarget,fileTraceTarget" /> | |
| <logger name="*" minlevel="Error" writeTo="fileErrorsTarget" /> | |
| </rules> | |
| </nlog> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment