Thursday, August 2, 2007

Quick ASP Log

Handy for debugging errors:
 
 
function writeLog(msg)
 
 Dim fso
 Dim logfile
 Dim logFileName
 Dim strLog 
 logFileName  = Server.MapPath("logfile.txt")
 Set fso = Server.CreateObject("Scripting.FileSystemObject")
 Set logfile = FSO.OpenTextFile(logFileName, 8, True)
 logfile.writeline now() & ":" & msg
 set fso = nothing
 set logfile = nothing
 
end function

No comments: