F7484CAA2E0E42D88F4BE47033CB9F88
  • RedDot CMS Blog
  • 30.12.2016
  • EN

rdb: Debugging PreExecute ASP – Reloaded

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:

  • see the Error files as html files in your browser
  • open an overview page with all logfiles which are existing in the folder.
     

Modifications

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.
 

Thank you

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... ;-)

       

Downloads

 

QuickLinks

 

Channel