Gavin Cope already came up this year with his great article on how to debug classic ASP script which runs in Open Text Management Servers PreExecute Mode. Keith Bloom picked up the idea and improved it a fair bit, so that you now are able to:
WriteToFile "C:\Program Files\RedDot\CMS\ASP\PreExecute\logs\PreExecuteErrors_" & Year(Now) & Month(Now) & Day(Now) & _ ".html", " Date/Time: " & Now() & "" & _ " ASP Code: " & objASPError.ASPCode & "" & _ "ASP Description: " & objASPError.Description & "" & _ " Category: " & objASPError.Category & "" & _ " Column: " & objASPError.Column & "" & _ " Description: " & objASPError.Description & "" & _ " File: " & objASPError.File & "" & _ " Line: " & objASPError.Line & "" & _ " Number: " & objASPError.Number & "" & _ " Source: " & objASPError.Source & "" & _ "############################################################" & "", True
This replaces the line .07 in Gavins code sample and writes the data with HTML line-breaks into a .html file.
Make sure your Program Files path is set correct.
Next step is to create a default.asp file (so that you just have to browse to the folder) or
ErrorList.asp file inside of the log file folder with the following code:
<% sDirectory = "CMS/ASP/PreExecute/logs/" sPath = Server.MapPath(sDirectory) Set fso = CreateObject("Scripting.FileSystemObject") Set currentFolder = fso.GetFolder(sPath) Set fileList = currentFolder.Files %> <html> <head> <title>Open Text Websolutions : PreExecuteErrors </head> <body> <h1>List of files <ul> <% For Each file in fileList %> <li><a href="<%= sDirectory & file.Name %>"><%= file.Name %> <% Next %> </ul> </body> </html> <% Set fileList = Nothing Set currentFolder = Nothing Set fso = Nothing %>
This should list all error files within your log folder.
Again thank you guys for share this ASP solution with us and spending some time on publishing it. Hopefully there will be a day when the CMS runs entirely in .NET as fastest available development language and we can use this within Open Texts Web Solutions Management Server to make the CMS world a better place... ;-)