Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rolled back last change, since I was not able to figure out how to use it.

Starting with Catel 3.8, it is possible to instantiate LogListener classes from the configuration. Below is an example on how to customize the listeners:

Code Block
<configuration>
  <appSettings>
    <configSections>

     <sectionGroup name="catel">
    
   <section name="logging" type="Catel.Logging.LoggingConfigurationSection, Catel.Core" />
 
    </sectionGroup>
  
 </configSections>
 

 <catel>
    
 <logging>
     
  <listeners>
      
   <listener type="Catel.Logging.FileLogListener" FilePath="{AppData}\CatelLogging.txt" IgnoreCatelLogging="true"

                   IsDebugEnabled="truefalse" IsInfoEnabled="true" IsWarningEnabled="true" IsErrorEnabled="true"/>
  
     </listeners>
    
 </logging>
   
</catel>    
  </appSettings>
</configuration>

It is important to register the logging section as shown in the example above. Then the logging section in the bottom can contain an unlimited number of listeners. Each listener has to provide at least the type property which contains the type and namespace of the ILogListener which must be added:

...