How to configure detail logging in PaperFlow R76 and above


Version: R76

Article ID: PF000094

How to configure detail logging in PaperFlow R76 and abovemain image

Description

This article explains how to configure additional detail logging options for PaperFlow versions R76 and above. Refer to Appendix B in the PaperFlow User Guide for more information on configuration settings.

Summary

The logging feature in PaperFlow can be configured to record events of your choosing. There are four sections in the configuration file that can be edited to customize the type and amount of logs created. The editable sections in the configuration file are:

  • loggingConfiguration - Edit this section to determine what events are created and how often they are updated.
  • categoryFilters: - Edit this section to determine which events will be logged.
  • categorySources: - Edit this section to select which level each category will log.
  • listeners – This element determines the destination to which each Category will log.

The loggingConfiguration section is used to determine whether or not performance statistics are logged, the default category, and how often events are written.

<loggingConfiguration tracingEnabled="false" defaultCategory="Trace"

eventRepeatThreshold="15">

The loggingConfiguration section consists of the following elements:

  • tracingEnabled – This element determines whether performance statistics are recorded for certain code-level operations. By default this is set to “false.” Setting this element to “true” will log performance statistics.
  • defaultCategory – This element determines the default Category that logging will use. By default this element is set to “Trace.” Generally there is no need to change this element.
  • eventRepeatThreshold – This element determines how often events are logged. By default, this element is set to “15” which means that when an event is logged, that same event won’t create another log for 15 minutes. It may be necessary to record all instances of an event. In that case, set this element to “0” which will then record all events (including duplicate events).

The categoryFilters element allows users to filter which events will be logged (Operation, Application, Debug, Trace, and PaperFlow Scheduling). By default, only events that are part of the Operation, Application, or PaperFlow Scheduling category are automatically logged. Debug and Trace are generally used for advanced troubleshooting.

<categoryFilters>

<!--Commented category filters will log and uncommented category

filters will NOT log.-->

<!--<add name="Operational" />-->

<!--<add name="Application" />-->

<add name="Debug"/>

<add name="Trace"/>

<!--<add name=”PaperFlowScheduling”/>

</categoryFilters>

The categorySources element contains the various logging categories that can be used for Digitech Systems applications (Operational, Application, Debug, and Trace). Each category includes a switch value that can be set to one of the following:

  • Critical
  • Error
  • Warning
  • Information
  • Verbose
  • All

The switch value determines how much logging is output for a given category. For example, by default, PaperFlow is automatically configured to log any “event” that is categorized as “Critical” or “Error” in the Operational, Application, or PaperFlow Scheduling categories.

<categorySources>

<!--switchValues are Critical, Error, Warning, Information, Verbose and

All-->

<add name="Application" switchValue="Error">

<listeners>

<!--Commented listeners will NOT log and uncommented

listeners will log.-->

<add name="Event Log Destination"/>

<!--<add name="Flat File Destination" />-->

<!--<add name="Email TraceListener" />-->

</listeners>

</add>

<!--switchValues are Critical, Error, Warning, Information, Verbose and

All-->

<add name="Operational" switchValue="Error">

<listeners>

<!--Commented listeners will NOT log and uncommented

listeners will log.-->

<add name="Event Log Destination"/>

<!--<add name="Flat File Destination" />-->

<!--<add name="Email TraceListener" />-->

</listeners>

</add>

<!--switchValues are Critical, Error, Warning, Information, Verbose and

All-->

<add name="Debug" switchValue="All">

<listeners>

<!--Commented listeners will NOT log and uncommented

listeners will log.-->

<!--<add name="Event Log Destination" />-->

<!--<add name="Flat File Destination" />-->

<!--<add name="Email TraceListener" />-->

</listeners>

</add>

<!--switchValues are Critical, Error, Warning, Information, Verbose and

All-->

<add name="Trace" switchValue="All">

<listeners>

<!--Commented listeners will NOT log and uncommented

listeners will log.-->

<!--<add name="Event Log Destination" />-->

<!--<add name="Flat File Destination" />-->

<!--<add name="Email TraceListener" />-->

</listeners>

</add>

<!--switchValues are Critical, Error, Warning, Information, Verbose and

All-->

<add name="PaperFlowScheduling" switchValue="Error">

<listeners>

<!--Commented listeners will NOT log and uncommented

listeners will log.-->

<add name="Event Log Destination" />

<!--<add name="Flat File Destination" />-->

<!--<add name="Email TraceListener" />-->

</listeners>

</add>

</categorySources>

To include any events that are categorized as “Warnings” for any or all categories, the categorySources must be changed from “Error” to “Warning” for each of the applicable Categories (Application, Operation, Debug, Trace, or PaperFlow Scheduling).

To include any and all events PaperFlow generates, set the switch value to “All” for all Categories. Note that this may generate a significant amount of output, and due to the extra processing required to output all of these entries, may adversely impact application performance.

Listeners

This element determines the destination where each Category will log such as: the Windows Event Viewer, a flat file, an email address, database, or even an external application (by creating a custom Event Handler). Logging to other destinations can be useful for a number of reasons. For example, logging to a flat file could prove useful when the logs need to be recorded for remote troubleshooting (e.g. under the direction of Technical Support). By default, PaperFlow logs errors to the Windows Event Viewer.

Setting the listeners to log to an email address may be useful when an administrator needs to be made aware of any possible issues immediately. When using the email option, a valid SMTP server is required.

Each listener provided includes options for that specific listener. For example, for flat files, you can specify the path and name of the file to which log entries will be written.

Enable Email Notification of Errors

A useful feature of PaperFlow is the ability to receive email notifications when the application encounters an error. By default, these errors are written only to the Windows event log, but with email notification enabled, users can also be directly notified of problems in their PaperFlow environment.

Note: when using the email option, a valid SMTP server is required.

To configure a Digitech application to send an email when an error occurs, follow these steps:

  1. Open the PaperFlow configuration file named, PaperFlow.exe.config, in a text editor. The default storage location for the configuration file is: C:\Program Files (x86)\Digitech Systems\PaperFlow.NET
  2. In each "<listeners>" section, activate the listener by eliminating the comment tags. Change this line: <!--<add name="Email TraceListener" />-->                                                                                                                                                                                                                                To this value: <add name="Email TraceListener" />
  3. Find the following section:

<add name="Email TraceListener" smtpServer="127.0.0.1" smtpPort="25" toAddress="to@example.com" fromAddress="from@example.com" subjectLineStarter="PaperFlow Event:" subjectLineEnder="" formatter="TextFormatter" listenerDataType-="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData,Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0,Culture=neutral, PublicKeyToken=469958bca2e00646" traceOutputOptions="None"type-="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener,Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0,Culture=neutral, PublicKeyToken=469958bca2e00646"/>

  1. Within this section, edit the following elements:
  • Change smtpServer="127.0.0.1" to the IP address of your SMTP server.
  • Change smtpPort="25" to the port being used by your SMTP server.
  • Change toAddress="to@example.com" to any email address to which these notifications must be sent. Multiple email addresses must be separated by a semi-colon (;).
  • Change fromAddress="@example.com" to the email address from which the notifications will be sent.
  1. Save and close the file.