Program startup option to record program events to help trace problems
The diagnostic logging facility helps trace software and hardware problems.
When logging is turned on, the program records software events to a log file. This file can be sent to the distributor for analysis.
Enabling logging
Add the argument ‘V12log’ to the Target field of the V12 desktop shortcut, for example:-
Target: e:\V12\V12.exe v12log
The default file name for logging is v12Log.txt located in the 'Documents' folder and the default logging level is ‘Extended’.
Note - the log file is never deleted by the program and if logging is left on for an extended period, this file may become very large.
Logging options
The logging argument takes three optional values to specify the logging file name, the logging level and whether the logging process should not display a logging error dialog (silent mode). The file name field can either be a file name or the full path of the logging file. If the file name or path contain spaces the file name field must be enclosed in double quotation marks.
V12 LOG=<path>,level,silent
Examples:-
V12 V12LOG
V12 V12LOG=c:\mylog.txt
V12 V12LOG=\\server\share\mylog.txt
V12 V12LOG="c:\My Log.txt",2,1
V12 V12LOG=,2,1
If the full path of the logging file is included, it must be an fully qualified path, not a relative one.
c:\Logs\Logging.txt - Fully qualified path (correct)
\Logs\Logging.txt - Relative path (incorrect)
Format of log file content
Each logging activity creates an ASCII CSV line with the following fields.
Date, Time, Activity code, Program name (full path), Process ID, Module name, User name, Extra information
Example:-
17-Apr-15, 09:15:25, 100, c:\V12\Menu.exe, 1234, Menu, Username,
17-Apr-15, 09:15:30, 100, c:\V12\Panel.exe, 1234, Bsrlib, Username,
17-Apr-15, 09:20:11, 199, c:\V12\Panel.exe, 1234, Bsrgui, Username,
Logging level
1 = Basic logging (program start / termination)
2 = Extended logging (includes basic and other activity start / end codes)
3 = Maximum logging (includes Basic, Extended and other specific operations)
Silent logging
If the software fails to write to the log file (e.g. if another user is logging to the same log file) a logging error dialog is displayed advising the user of this problem. To prevent the display of this dialog users can configure silent logging. This is set by specifying a value of 1 as the third value of the logging options.
e.g.
V12 V12LOG="c:\My Log.txt",2,1
When silent logging is configured if it is not possible to write to the specified log file the software writes the log text to an alternative log file with the same name but with a two-digit number appended to the extension.
e.g.
v12log.txt_01
v12log.txt_02
The logging process will attempt to store the log information in an alternative file with _01 appended first. If that is not successful _02 is used, then _03 up to a maximum of _10. If it is not possible to store the log information in an alternative file, the information is not stored and the software continues.
Logging in stand alone applications
When running stand alone V12 applications, logging can be enabled by setting an environment variable (V12LOG). Environment variables are set via the Windows Control panel. If set the environment variable always takes precedence over the command-line argument.
Logging for stand alone applications is always silent so it is not necessary to configure silent logging.
Location of log file
If no log file name is specified, logging output is stored in the file v12log.txt in the 'Documents' folder.
If a file name is specified without a path (location) the log file is located in the current directory, or the 'Start in' folder if configuring logging in the desktop shortcut.
Optimiser diagnostic logging on multi-core/multiple processor systems
Multiple log files are used to record logging events on these systems. The additional log files have the same core name as the main log file with a zero-padded two digit number appended.
v12log.txt
v12log_01.txt
v12log_02.txt
Notes
- It is not possible to turn logging off whilst an application is running.