|
Log Object |
|
See Also: |
The Log.Path property sets/returns the complete path of the log file.
VBScript:
JScript:
| Log | The Log object. |
| strPath | A string indicating the new path of the log file. A relative or absolute path can be used. |
When setting the Path property, the strPath parameter may be an absolute path or a relative path. Relative paths are resolved using the previous Log.Path value. The Filename and Dir properties are adjusted to match the new path. The Output.Path topic lists some valid strPath values.
When reading the Path property, the complete path is returned.
The Path value is a combination of the Dir value and the Filename value. When Log.Write is first called, the Path value is used to determine the location of the log file.
If the Path value is changed after log entries have been written, the old log file is closed. Note that errors and warnings from parsing and compiling an APG script may cause log entries to be written before any script is executed. Setting a new Log.Path at the beginning of a script only changes the log file where run-time errors are reported - if you want parse and compile errors to be sent to the same file, you should change the APGScript.Log.Path value before the script is run. The following example shows how.
This example shows how to set the log file for a script before the script is parsed, compiled, and run. That way, parsing errors, compile errors, and run-time errors are all sent to the same log file.
<%#
Dim oScript
Set oScript = APGen.OpenScript("script.apg")
' Change the log file for the script
oScript.Log.Path = "..\logfiles\build.log"
' Parse, compile, and run the script
oScript.Run
#%>