ALP Response.AppendtoLog method
Writes a string to the log file.

Syntax:

Response.AppendToLog string

Parameters:

string - The method converts this to a string and writes it to the log file. 

Examples:

JScript:

<% Response.AppendToLog("My variable X=" + X) %>

VBScript:

<% Response.AppendToLog "My variable X=" & X %>

Remarks:

ALP automatically creates or appends the log file when this method is used. The log file is named alplog.txt and is created in the root of the Virtual ALP site. No errors are reported if the file cannot be created (for example on read-only media). Note that you should remove/comment all the unneeded AppendToLog calls in the retail version of the application in order to prevent creation of huge log files no one would want to use.

When to use? In many cases it is more convenient to use Response.Write to output trace information from the ASP pages. However, the design of some pages may cause problems for such an approach (for example the output may fall in a select box). In such cases you would want to separate the trace information from the regular page output and the AppendToLog method will help you do that.

If you want to clear the log file automatically you can do this in the global.asa - for example in the Application_OnStart function. To do so you will need to use SFMain object to delete the exiting log file.

Applies to: Response object

newObjects Copyright 2001-2006 newObjects [ ]