Logging Configuration
Default location:
The logging configuration file 'NLog.config' is, by default, located in the application’s directory, for example: C:\Program Files (x86)\Trisoft\11.1\Publication Manager\NLog.config)
Log Level:
Available log levels are :
- Trace
- Debug
- Info
- Warn
- Error
- Fatal
By default, only Fatal, Error, and Warning messages are logged.
Change the log level to increase or change logging. For example, when you set the minimum level to Trace, all messages are logged.
Sample configuration file:
All messages, from any class in the application whose level is
Warn or higher, that is, Warn, Error, and Fatal, are written to the file C:\Users\<user name>\AppData\Locak\Trisoft\InfoShare Client\11.1\Log\Publication Manager.log.
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<include file="NLog.Include.ClientApplications.config"/>
<targets>
<target name="File"
xsi:type="File"
layout="${fileLayout}"
fileName="${environment:variable=USERPROFILE}\Local Settings\Application Data\Trisoft\InfoShare Client\11.1\Log\Publication Manager.log"
archiveAboveSize="2000000"
maxArchiveFiles="3"
archiveNumbering="Rolling"
keepFileOpen="false"
/>
</targets>
<rules>
<logger name="*" minLevel="Warn" writeTo="File"/>
</rules>
</nlog>
To enable maximum logging, set the minimum level to
Trace.
... <logger name="*" minLevel="Trace" writeTo="File"/> ...
For more information about configuring logging, refer to the NLog Configuration file.