Platform SDK: Web Telephony Engine

Writing Log Information to a File

When file logging is selected, WTE creates the log file in shared-read mode, permitting the file to be read at all times. The configuration parameters for logging must specify a valid log-file directory if logging is to work. The log data is flushed to the file when the internal buffer is full, or every 30 seconds, whichever comes first. The log data is also flushed automatically after an authoring error occurs. To flush the log data to the file programmatically, pass the wteServiceFlushLog service-control value to the Microsoft® Win32® ControlService function. The wteServiceFlushLog service-control value is one of the enumerated values in PrivateWTEControlsType, defined in mswteenum.h.

To select file logging through the WTE administration object model, set the WTELog.LogType property to wteLogToFile.

When file logging is selected, the following parameters must also be specified:

Log File Directory
The directory under which the log files will be created. To specify the directory programmatically, use the WTELog.LogFileDirectory and WTELog.LogFileDirectoryType properties.
Log File Period
The period after which a new log file will be created. To specify the log period programmatically, use the WTELog.LogFilePeriod property.

The possible log file periods are:

Daily
A new file is created every day at midnight. The file name consists of the letters "WTE" followed by the date and the extension "log"; for example:
WTED19991231.log
Weekly
A new file is created every week. The file name consists of the letters "WTEW" followed by the year, month and week of the month; for example:
WTEW1999125.log
Monthly
A new file is created every month. The file name consists of the letters "WTEM" followed by the year and month; for example:
WTEM199912.log
Yearly
A new file is created every year. The file name consists of the letters "WTEY" followed by the year; for example:
WTEY1999.log
Log Files Compress
Windows NT®/Windows® 2000 permits the use of compressed files on NTFS file system partitions. Selecting this property will cause all new files to be generated as compressed files. If the compression fails, because the file system is not NTFS or for some other reason, the files are created as ordinary files without compression. To specify log-file compression programmatically, use the WTELog.LogFilesCompress property.