Jump to: navigation, search

Configuration Files/Logging.config


Revision as of 10:14, 7 July 2023 by NNE (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Logging Configuration for Version 3.6 or newer

  • With Version 3.6 we Replaced our existing Microsoft.Practices.EnterpriseLibrary. Logging with more up-to-date solutions like Serilog.
<LoggingConfiguration>
  <add key="LogRootPath" value=""/>
  <!-- Values can be "Verbose", "Debug", "Information", "Warning", "Error", "Fatal". Normally "Debug" should be fine and you should only change if you know well what you do. -->
  <add key="LogLevel" value="Debug"/>
  <!-- The most recent 31 files are retained by default (i.e. one long month). If the value is empty the default will be applied. You must specifically set value="null" to remove this limit and all log files will be kept. You can set any other positive number -->
  <add key="RetainedFileCountLimit" value="31"/>
  <!-- Value can be either "Day", "Month" or "Year". Default is "Day"-->
  <add key="RollingInterval" value="Day"/>
</LoggingConfiguration>

Logging Configuration for Version 3.5 or earlier

Configure the logging, for example set the destination paths of the log files or enable / disable logging at all. Find an example file below and see Logging Application Block Properties for further details.


IC Attention.pngThe specified path of the destination files must be accessible by the user, either configured for the services or running the UBIK® Studio.
IC Attention.pngThe categories (WARNING, ERROR, DEBUG, ...) set in the these section "categorySources" should not be renamed, as these names are used by the UBIK system!


  <loggingConfiguration name="" tracingEnabled="true" defaultCategory="ASSERTION">
    <listeners>
      <add name="log.warning" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="\\UBIKFileServer\UBIK.Service.Logs\warnings.log" footer="" formatter="Text Formatter SMALL" header="-----------------------------------------------------------------" rollFileExistsBehavior="Increment" rollInterval="None" traceOutputOptions="None"/>
      <add name="log.error" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="\\UBIKFileServer\UBIK.Service.Logs\error.log" footer="" formatter="Text FormatterFULL" header="-----------------------------------------------------------------" rollFileExistsBehavior="Increment" rollInterval="Week"/>
      <add name="log.assertion" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="\\UBIKFileServer\UBIK.Service.Logs\assertion.log" footer="" formatter="Text Formatter ASSERTION" header="-----------------------------------------------------------------" rollFileExistsBehavior="Increment"/>
      <add name="log.debug" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="\\UBIKFileServer\UBIK.Service.Logs\debug.log" footer="" formatter="Text Formatter SMALL" header="----------------------------------------" rollFileExistsBehavior="Increment"/>
      <add name="log.error.header" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="\\UBIKFileServer\UBIK.Service.Logs\debug.error.header.log" footer="" formatter="Text Formatter TINY" header="-------------------------------------" rollFileExistsBehavior="Increment"/>
      <add name="servicelog" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="C:\UBIK_Logs\SericeLogs\Infopath.V2\infopath_service_v2.log" footer="" formatter="Text Formatter.SERVICE"/>
      <add name="servicelog.rolling" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="\\UBIKFileServer\UBIK.Service.Logs\service.build.V2.log" footer="" formatter="Text Formatter.SERVICE" header="########################################" rollFileExistsBehavior="Increment" rollSizeKB="1000" maxArchivedFiles="50"/>
      <add name="log.workflow" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="\\UBIKFileServer\UBIK.Service.Logs\workflow.log" footer="" formatter="Text Formatter.SERVICE" header="########################################" rollFileExistsBehavior="Increment" rollSizeKB="1000" maxArchivedFiles="50"/>
      <add name="log.customizing" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          fileName="\\UBIKFileServer\UBIK.Service.Logs\customizing.log" footer="" formatter="Text Formatter.SERVICE" header="########################################" rollFileExistsBehavior="Increment" rollSizeKB="1000" maxArchivedFiles="50"/>
    </listeners>
    <formatters>
      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
       template="Timestamp: {timestamp}{newline}&#10;Message: {message}{newline}&#10;Category: {category}{newline}&#10;Priority: {priority}{newline}&#10;EventId: {eventid}{newline}&#10;Severity: {severity}{newline}&#10;Title:{title}{newline}&#10;Machine: {localMachine}{newline}&#10;App Domain: {localAppDomain}{newline}&#10;ProcessId: {localProcessId}{newline}&#10;Process Name: {localProcessName}{newline}&#10;Thread Name: {threadName}{newline}&#10;Win32 ThreadId:{win32ThreadId}{newline}&#10;Extended Properties: {dictionary({key} - {value}{newline})}" name="Text FormatterFULL"/>
      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
       template="{timestamp}{newline}&#10;{category} [{eventid}]{newline}&#10;{processName}{newline}&#10;{message}{newline}" name="Text Formatter ASSERTION"/>
      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
       template="{timestamp}{newline}&#10;{category} [{eventid}]&#10;{processName}{newline}&#10;{message}{newline}&#10;Extended Properties: {dictionary({key} - {value}{newline})}" name="Text Formatter SMALL"/>
      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
       template="{timestamp}  {message}{newline}" name="Text Formatter TINY"/>
      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
       template="{timestamp}{newline}&#10;{processName}{newline}&#10;{newline}&#10;Parameter: {newline}&#10;----------------{newline}&#10;{dictionary({key} - {value}{newline})}&#10;{newline}&#10;Result:{newline}&#10;----------------{newline}&#10;{message}{newline}&#10;&#10;" name="Text Formatter.SERVICE"/>
    </formatters>
    <categorySources>
      <add switchValue="All" name="ASSERTION">
        <listeners>
          <add name="log.assertion"/>
        </listeners>
      </add>
      <add switchValue="All" name="WARNING">
        <listeners>
          <add name="log.warning"/>
        </listeners>
      </add>
      <add switchValue="All" name="ERROR">
        <listeners>
          <add name="log.error.header"/>
        </listeners>
      </add>
      <add switchValue="All" name="DEBUG">
        <listeners>
          <add name="log.debug"/>
        </listeners>
      </add>
      <add switchValue="All" name="EXCEPTION">
        <listeners>
          <add name="log.error"/>
        </listeners>
      </add>
      <add switchValue="All" name="SERVICE">
        <listeners>
          <add name="servicelog.rolling"/>
        </listeners>
      </add>
      <add switchValue="All" name="WORKFLOW">
        <listeners>
          <add name="log.workflow"/>
        </listeners>
      </add>
      <add switchValue="All" name="CUSTOMIZING">
        <listeners>
          <add name="log.customizing"/>
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events"/>
      <notProcessed switchValue="All" name="Unprocessed Category"/>
      <errors switchValue="All" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="log.error"/>
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>

See also