Search code examples
iis-7asp-classicsyslog

404 error page writing to syslog in asp


I have a custom 404 page that is written in classic ASP. I am trying to set up that when the page is hit, it should send a log through syslog. How do I write that out?


Solution

  • You can log events from Classic ASP using:

    dim WshShell
    set WshShell = Server.CreateObject("WScript.Shell")
    wshshell.Logevent 1, "Page not found - your message here!"
    set wshshell=nothing
    

    You can find more details, such as the different warning levels on MSDN - Logging Events from ASP.