Diagnostics Configuration

The DiagnosticsConfigurationSection controls the logging and error reporting infrastructure.

  <section xsi:type="DiagnosticsConfigurationSection">
      <add name="SanteDB.Core.DataSet" filter="Warning"/>
      <add name="console" initializationData="" filter="Informational">
        <writer>SanteDB.Core.Diagnostics.ConsoleTraceWriter, SanteDB.Core, Version=, Culture=neutral, PublicKeyToken=null</writer>

Source Filters

By default, all log requests are sent to the logging infrastructure, you can, however, control/filter the events from each source by adding it to the <sources> element. For example, to have the FHIR logs at level Error and the HL7v2 logs at Warning:

      <add name="SanteDB.Messaging.FHIR" filter="Error" />
      <add name="SanteDB.Messaging.HL7" filter="Warning" />

When configured in this manner, only errors reported by the FHIR source will be logged to the application logs.

Log Writers

Writers are registered/configured in the <writers> element and are given a name, initialization data (like file name, port number, etc.) and a filter.

      <add name="main" initializationData="santedb.log" filter="Warning">
        <writer>SanteDB.Core.Diagnostics.RolloverTextWriterTraceWriter, SanteDB.Core, Version=, Culture=neutral, PublicKeyToken=null</writer>

The writers which are available in SanteDB iCDR and dCDR are:


Logs To




Specified file


.NET Trace Writer infrastructure


Windows Event Log


Android device developer log

Last updated