Jump to: navigation, search

Difference between revisions of "HowTo:Configure Logging"


 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
To document certain events (errors, warnings, etc.) that occur in the {{UBIK}} system, a logging mechanism is provided to support the designer or programmer in finding issues in the design process or to identify the reason for problems at runtime. Logging in {{UBIK}} can be configured for the Web Service as well as for the {{UBIK Studio}}. The general configuration for logging is described [http://msdn.microsoft.com/en-us/library/ms733830%28v=vs.110%29.aspx here].
+
== Configure Logging for Version 3.5 or earlier ==
 +
By default, logging is switched on using default setttings, for example for the destination path of the logging files. See [[Configuration_Files/Logging.config|Logging.config]] for an example of a configuration file for logging.
  
* The logging for the Web Service can be configured via editing the [[Web_Service_Configuration|web service configuration]] in section [[Web_Service_Configuration_Example#loggingConfiguration|loggingConfiguration]].
+
=== Switch off logging  ===
 
+
* The logging in {{UBIK}} Studio can be configured by editing the file '''UBIK.Studio.exe.config''', which is located in the program folder of {{UBIK}} Studio and also contains the section [[Web_Service_Configuration_Example#loggingConfiguration|loggingConfiguration]] which can be configured in the same way like the {{UBIK}} Web Service.
+
 
+
==Logging categories==
+
 
+
{{UBIK}} has different types of categories configured for the logging mechanism. The following categories can be configured in the configuration files. Categories with the remark '''internal''' are available via customizing code, but are used to log internal events. As it is not recommended to mix logging of internal events together with others, the two additional categories '''CUSTOMIZING''' and '''WORKFLOW''' have been created.
+
 
+
{| class="wikitable" | width = "88%"
+
 
+
|-
+
! Type!! Description!! Access
+
|-
+
| CUSTOMIZING || Log for events that occured in the customizing. This method is available by calling <code>UBIKKernel.LogCustomizing(...)</code> from the customizing code. || public
+
|-
+
| WORKFLOW || Log for events that occured when running workflows which is provided by the [[WriteLogEntry_(Activity)|WriteLogEntry Activity]] || public
+
|-
+
| ASSERTION || Log for failed Assertions || internal
+
|-
+
| WARNING || Log for events that created a warning || internal
+
|-
+
| ERROR ||  Log for events that created an error || internal
+
|-
+
| DEBUG ||  Log for events that have to be investigated in the development || internal
+
|-
+
| SQL || Log for events related to SQL queries || internal
+
|-
+
| EXCEPTION || Log for events that caused an exception || internal
+
|-
+
|}
+
 
+
== Switch off logging ==
+
 
Turning off logging can be done by setting the '''switchValue''' in the Category Source to '''Off''' in the corresponding config files:
 
Turning off logging can be done by setting the '''switchValue''' in the Category Source to '''Off''' in the corresponding config files:
* '''UBIK.Studio.exe.config''' for {{UBIKSTUDIO}}
+
* '''UBIK.Studio.exe.config''' for {{UBIK Studio}}
 
* '''Web.config''' for the webservice
 
* '''Web.config''' for the webservice
  
Line 53: Line 23:
 
</source>
 
</source>
  
[[File:UI_Configure_Logging_EntLibConfig.png|220px|thumb|border|alt=Configure logging|Configure logging]]
+
[[File:UI_Configure _Logging_EntLibConfig.png|220px|thumb|border|alt=Configure logging|Configure logging]]
 
Instead of editing the config files, it is also possible to use the graphical configuration tool from the [http://www.microsoft.com/en-us/download/details.aspx?id=15104 Enterprise Library]. After installing the package open the config file with the tool and switch on or off logging for each category as shown.
 
Instead of editing the config files, it is also possible to use the graphical configuration tool from the [http://www.microsoft.com/en-us/download/details.aspx?id=15104 Enterprise Library]. After installing the package open the config file with the tool and switch on or off logging for each category as shown.
 
{{Clear}}
 
{{Clear}}
  
 
==See also==
 
==See also==
* [[Activity:WriteLogEntry_(Activity)|WriteLogEntry (Activity)]]
+
* [[Logging]]
 +
* [[Configuration_Files]]
 
* [[Web_Service_Configuration|Web service configuration]]
 
* [[Web_Service_Configuration|Web service configuration]]
 +
* [[Activity:WriteLogEntry_(Activity)|WriteLogEntry (Activity)]]
 +
* [[Serilog]]
 +
{{Category/Version|3.5.0}}
  
[[Category:Installing]]
+
[[Category:3.5.0|Configure Logging]]
[[Category:Server]]
+
[[Category:How-To|Configure Logging]]
[[Category:How-To]]
+
[[Category:Installing|Configure Logging]]
 +
[[Category:Server|Configure Logging]]

Latest revision as of 11:23, 24 November 2020

Configure Logging for Version 3.5 or earlier

By default, logging is switched on using default setttings, for example for the destination path of the logging files. See Logging.config for an example of a configuration file for logging.

Switch off logging

Turning off logging can be done by setting the switchValue in the Category Source to Off in the corresponding config files:

  • UBIK.Studio.exe.config for UBIK® Studio
  • Web.config for the webservice
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="ASSERTION">
...
   <categorySources>
     ...
     <add switchValue="Off" name="ASSERTION">
        <listeners>
           <add name="log.assertion"/>
        </listeners>
     </add>
   ...
   </categorySources>
...
</loggingConfiguration>
Configure logging
Configure logging

Instead of editing the config files, it is also possible to use the graphical configuration tool from the Enterprise Library. After installing the package open the config file with the tool and switch on or off logging for each category as shown.

See also