Logging in bpm’online. Log4net
Glossary Item Box
Introduction
Logging is useful for localization of application troubles. Bpm’online enables logging for all main operations.
The Lof4net solution is used for logging. This tool enables to perform logging of parameters from different components of the application into separate log files.
Logging is performed separately for the application loader and for the Default configuration. To set up logging, modify the ..\Terrasoft.WebApp\log4net.config configuration file.
Storing log data
ATTENTION
Location of the log files depends on the value of Windows system variables.
By default the loader log files are located by following path:
[TEMP]\BPMonline\Site_[{SiteId}]\[{ApplicationName}]\Log\[{DateTime.Today}]
Example:
C:\Windows\Temp\BPMonline\Site_1\bpmonline7121\Log\2018_05_22
Files with the Default configuration logs are located by following path:
[TEMP]\BPMonline\Site_[{SiteId}]\[{ApplicationName}]\[ConfigurationNumber]\Log\[{DateTime.Today}]
Example:
C:\Windows\Temp\BPMonline\Site_1\bpmonline7121\0\Log\2018_05_22
Variables specified in the square brackets:
- [TEMP] – the base folder. By default the C:\Windows\Temp folder is used by IIS and the C:\Users\{User name}\AppData\Local\Temp folder used by Visual Studio (IIS Express).
- [{SiteId}] – site number. For the IIS, the number is specified in the site advanced settings (Fig. 1). For the Visual Studio the number is 2.
- [{ApplicationName}] – application name (Fig. 1).
- [ConfigurationNumber] – configuration number. The number for the Default, configuration usually is 0.
- [{DateTime.Today}] – logging date.
Fig. 1. Advanced setting of the IIS site
Changing the logging level
By default the logging level for all bpm’online components is set to provide maximal performance for the application. Possible levels of logging in order of increasing priority:
- ALL – logging of all events. Significantly reduces application performance.
- DEBUG – logging all events at debugging.
- INFO – logging of errors, warnings and messages.
- WARN – logging of errors and warnings.
- ERROR – logging of errors.
- FATAL – logging only errors that lead to the termination of the component being logged.
- OFF – logging disabled.
Example 1. Set the maximum level of logging for all components
To do this, specify the ALL level in the <root> XML element of the .\Terrasoft.WebApp\log4net.config file.
<root> <level value="ALL" /> <appender-ref ref="commonAppender" /> </root>
Example 2. Set logging of errors when working with SVN
To do this, specify the ERROR level in the <logger name="Svn"> XML element of the .\Terrasoft.WebApp\log4net.config file.
<logger name="Svn" > <level value="ERROR" /> <appender-ref ref="SvnAppender" /> </logger>