|
Log Object |
|
See Also: |
The Log.Write() method writes an entry to the log file.
VBScript:
JScript:
| Log | The Log object. |
| strText | Text to be written in the log file entry. |
| severity | Optional. An ApgLogSeverityEnum value. The default value is apgSeverityInfo. |
| lngCode | Optional. A long integer value to be written with the log file entry. The default value is zero. |
Log.Write() writes an entry to the log file specified by Log.Path. The log file is a comma-separated value text file, with fields time, severity, code, and text for each log entry.
APGen internally calls Log.Write() when fatal errors, errors, and warnings occur. You may use any of the severity values when calling Log.Write() in script.
The Log.Flags property allows you to filter which Log.Write() calls are written to the log file. The default value for Log.Flags is apgLogDefault, which lets all Log.Write() calls write to the log file. Setting Log.Flags to apgLogNothing prevents any Log.Write() calls from writing to the log file. The following table lists which Log.Write() calls are filtered by which Log.Flags flags.
| Log.Write Severity | Filtered by this Log flag |
| apgSeverityInfo | apgLogInfo |
| apgSeverityWarning | apgLogWarnings |
| apgSeverityError | apgLogErrors |
| apgSeverityFatal | apgLogFatalErrors |
| apgSeverityUnknown | apgLogInfo |
This example writes an entry in the log file to report that script execution was successful.
<%# @LANGUAGE=JScript #%>
<%#
...
// Log that the script completed successfully
Log.Write("Script '" + Script.Path
+ "' completed successfully", apgSeverityInfo);
#%>