Error log not giving me a line number

rivkamak
rivkamak used Ask the Experts™
on
I have an asp script on my 500 error page that sends me an email when someone hits the page.

the scripts works perfectly on all my sites, but 1 site on the same server it doesn't pass my the line number.
Is something set up incorrectly on IIS7
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Does it produce a line number in the IIS logs? (in teh IIS logs it says the error and description for classic asp errors)
Or does you custom page mess up this?

Author

Commented:
the custom page doesn't give me the right number. I want to be able to see the error and line number on the page as I hit the error, without having to go back into the server?
Where can I see the line number in the IIS error logs
Top Expert 2016
Commented:
source


Note though that you cannot use this in your standard asp application pages and expect it to work. You need to modify the default error page (500-100.asp) which handles ASP error reporting and displays the results on the screen. To get the error emailed to you you can replace this page with your own version which will display a custom message to the user and then email the error report to you.
The syntax for returning the line number of the ASP error using the GetLastError object is :

set objError = Server.GetLastError()
strErrorLine = objError.Line

Open in new window

Author

Commented:
BINGO!
Thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial