// you’re reading...

CMS

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 FilesRedDotCMSASPPreExecutelogsPreExecuteErrors_" & 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..
;-)

Share and Enjoy:
  • Print
  • email
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • del.icio.us
  • MisterWong
  • Facebook
  • LinkedIn

No related posts.

About the author:

Markus Giesen Markus Giesen is a Solutions Architect and RedDot CMS Consultant, formerly based in Germany. Travelling around the world to find and offer solutions for a better world (in a very web based meaning). He just found a way to do this as part of a Melbourne based online consultant house. On this blog Markus shares his personal (not his employers) thoughts and opinions on CMS and web development. In his spare time you will find him reading, snowboarding or travelling. Also, you should follow him on Twitter!

Discussion

No comments for “Debugging PreExecute ASP – Reloaded”

Post a comment



Stay up to date! - Get notified about followup comments

If you don't feel the urge to comment but wish to stay in the loop:
Just enter your email and subscribe to new comments.

Subscribe without commenting

Recent Tweets

  • RT @AirKraft: Transport Canada breakout: they manage 80K pages and 300K assets with WSM(RedDot). Wow! #OTCW 2010-11-11
  • The RedDot usergroup session 'Future of WCM' is in National Harbor 7, now. See you there! #otcw 2010-11-11
  • RT @yttergren: @AirKraft: Calling all WSM(RedDot) devs: share your solutions on http://bit.ly/bgPIof EVERY solution can win an iPad #OTCW 2010-11-10
  • Come to the Solution Exchange session. Enhance your (#reddot) CMS project! Chesapeake 12, 3:20pm #otcw Looking forward to see you there! 2010-11-10
  • More updates...