LogMode Property

       

Returns a value which determines how logging (through the LogEvent method) will be carried out. Read-only at run time.

Syntax

object.LogMode = mode

Part Description
object An object expression that evaluates to an object in the Applies To list.
mode Long. Determines the method of logging, as shown in Settings below.

Settings

The settings for mode are:

Constant Value Description
vbLogAuto 0 If running on Windows 95, this option logs messages to the file specified in the LogPath property. If running on Windows NT, messages are logged to the Windows NT Application Event Log, with "VBRunTime" used as the application source and App.Title appearing in the description.
VbLogOff 1 Turns all logging off. Messages from UI shunts as well as from the LogEvent method are ignored and discarded.
VbLogToFile 2 Forces logging to a file. If no valid filename is present in LogPath, logging is ignored, and the property is set to vbLogOff.
VbLogToNT 3 Forces logging to the NT event log. If not running on Windows NT, or the event log is unavailable, logging is ignored and the property is set to vbLogOff.
VbLogOverwrite 0x10 Indicates that the logfile should be recreated each time the application starts. This value can be combined with other mode options using the OR operator. The default action for logging is to append to the existing file. In the case of NT event logging, this flag has no meaning.
VbLogThreadID 0x20 Indicates that the current thread ID be prepended to the message, in the form "[T:0nnn] ". This value can be combined with other mode options using the OR operator. The default action is to show the thread ID only when the application is multi-threaded (either explicitly marked as thread-safe, or implemented as an implicit multithreaded app, such as a local server with the instancing property set to Single-Use, multithreaded).

Return Type

Long