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, in addition to setting VerboseLogging to true as done prior to 5.7 (see sections below), you now need to configure the NLog configuration file.
For web applications, 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.
For desktop applications including ClickOnce applications, the nlog configuration file is called nlog.config.
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 which Verbose Log messages to write to the file
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. 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.
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