Enabling Tracing |
This chapter includes basic information how to setup tracing in DataPorter.
To enable tracing in DataPorter please modify the following configuration file ‘CAS.DataPorter.exe.config’, which is located in the installation folder (default location: ‘C:\Program Files\CAS.DataPorter’). This file is an XML file and can be edited by any text editor.
The section responsible for tracing is located between ‘<system.diagnostics>’ and ‘</system.diagnostics>’. Default configuration is provided with two sources (this is first subsection – “sources”):
CAS_BaseStation_Transactions (responsible for tracing in the transaction engine)
CAS_OPC_OPC_Interface (responible for tracing events refers to OPC interface)
Next tracing section that the user can find is switches. After line: <!-- SourceLevels Enumeration --> the user can specify different levels of details that he wants to display. The possible levels are: Off, All, Critical, Error, Verbose, Warning, and Information. For example, to obtain all information, replace ‘Off’ with ‘All’ in the default configuration. The last subsection is "sharedListeners". Here, the user can specify the name of destination listener (e.g. file name, default filename is ‘log\DataPorter.log’) where information is sent and the information filtering method (e.g.: All, Off, etc.). Files are created in the installation folder, but the user can specify the path where the file should be created (e.g. initializeData ="C:\Allcalc.log"). Tracing allows to receive information in different formats, e.g. please change ‘System.Diagnostics.DelimitedListTraceListener’ to one of options presented below:
‘System.Diagnostics.XmlWriterTraceListener’ – generates XML file (name of the file with extension .xml)
‘System.Diagnostics.TextWriterTraceListener’ – generates more user-friendly data output (extensions .log, .txt)
‘System.Diagnostics.EventLogTraceListener’ – putting information to the system log
‘System.Diagnostics.DelimitedListTraceListener’ – is a default option and it is very easy to import it to Microsoft Excel