How to Enable Verbose Logging
Posted by Diane Hancock on 20 November 2017 05:16 PM
5.7 and Later
NLog is used for verbose logging. A default nlog configuration file is installed with each application.
To enable logging:
That is it. The subsequent sections give additional information if needed.
Where to Find the NLog Configuration File
The nlog configuration file is called web.nlog. and is located in the same directory the application's web.config.
If this is missing, then nlog looks for a nlog.config in the bin directory.
The nlog configuration file is called nlog.config.
NLog Configuration File Information
The NLog configuration file defines the name of the log file (e.g. debuglog.txt), the format the messages and what messages are written to the log.
<target> elements define the name of the log file and the format of the messages
<logger> elements define rules that determine which Verbose Log messages to write to the file. The <logger> rules are sequentially evaluated individually not collectively. When a rule matches, irrelevant of other rules, the message is written. To stop the application of further rules once a rule matches, include the final="true" attribute.
name attribute defines the category of message. Use an asterisk (i.e. *) to write all categories of messages. Supported categories are included in the temple log files.
minlevel attribute defines what type of messages to write. Levels supported: error, warn, info, debug, trace, off. Everything at and to the left of the specified level are written. In other words, if minlevel="debug" then all error, warn, info and debug messages will be written unless a maxLevel is included. To exclude a category of message, then set the name to the category, the minLevel to off, and final to true.
maxLevel attribute defines the maximum level of message that will be written. Therefore, to make a rule apply only to debug type messages, set minLevel to debug and maxLevel to debug.
If the nlog configuration file was not installed with the application, then copy one from another Foray application that has it.
Prior to 5.7
Verbose Logging is always output to: debuglog.txt
The way to enable is dependent on the type of application as described in the following sections.
Web applications (e.g. Adams Web)
In the web.config file, set the VerboseLogging configuration setting to true.
After changing the setting, recycle the application pool.
Desktop applications (e.g. Digital Workplace)
In the configuration file: <application name>.exe.config (replace <application name> with the name of the application), set the VerboseLogging configuration setting to True
\v on command line
ClickOnce applications (e.g. Adams Bridge)
Starting with v5.9, this no longer applies as all logging for ClickOnce applications is controlled through the nlog.config file.
Run this command replacing <username> with the user's profile name:
"C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Foray Adams Bridge.appref-ms" /signalrtrace,/v