asp.net errors in iis log

A

Aaron

I would like to write a program that finds all asp.net errors in iis logs?
what characteristics should i look for? (a line in the log that has the
error?)
what about sql errors?

Thanks in advance,

Aaron
 
J

Juan T. Llibre

Check out Log Parser 2.2
http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx

A little tweaking of the sample scripts provided should get you what you want.

A sample for a console application is at:
http://samples.gotdotnet.com/quickstart/howto/doc/LogInfo.aspx

Samples for ASP.NET applications are at :
http://www.aspheute.com/english/20000811.asp
and
http://www.rassoc.com/gregr/weblog/archive.aspx?post=570

It shouldn't be too difficult to tweak them to get what you're looking for.
 
A

Aaron

what's the difference between IIS log and Events log?

Can I use this method to find ASP errors too?

Note: I want to be able to categorize asp, asp.net and sql errors. Not just
all errors.

Aaron
 
K

Kristofer Gafvert [MVP]

SQL Server does not write anything into the IIS log.

SQL Server logs either to the Application Log (Event Log), or its own log
located in Program Files\Microsoft SQL Server\Mssql\Log folder (by
default). The name of the file is ErrorLog.


--
Regards,
Kristofer Gafvert (IIS MVP)
www.gafvert.info - My Articles and help
www.ilopia.com

what's the difference between IIS log and Events log?

Can I use this method to find ASP errors too?

Note: I want to be able to categorize asp, asp.net and sql errors. Not just all errors.

Aaron
logs? >>what characteristics should i look for? (a line in the log that
has the >>error?)
 
J

Juan T. Llibre

re:
what's the difference between IIS log and Events log?

IIS has its own set of logs, in the directory %windir%\system32\LogFiles.

There, you'll find logs for HttpErr, Shutdown, SMTP services
( if you're running an SMTP service ) and W3C Services ( web logs ).

The Event Logs are stored at %windir%\System32\Config

As Kristofer already posted, SQL Server logs either to the
Application Log (Event Log), or its own log located in
Program Files\Microsoft SQL Server\Mssql\Log folder
(by default). The name of the file is ErrorLog.

Log Parser can read any of those files, and parse and create reports from them.
 
B

Bernard Cheah [MVP]

I'm not sure about asp.net as it has its own error handling routine and only
log status code and minor info in IIS.
Unlike ASP engine, which it logs more info in the IIS log file. I wrote this
chapter in the Log Parser 2.2 book.
Chap2 - Monitoring IIS
http://www.iis-resources.com/downloads/LPChap2.zip

from:
----
Under normal circumstances, these type of errors are often caused by coding
error in the server-side query, for example, |12|800a0009|
Subquery_out_of_range:_'arrayA(...)'. This error indicates that the arrayA
defined in in a server-side query is out of range. The format normally
starts with a pipe character followed by a line number, another pipe
separator, the error code, and finally one last pipe separator with an ASP
error message.

----

and here's the query for parsing ASP 500 related error.
---Ch02AspErrors.sql---

SELECT

Uri, Errorcode, ErrorMsg, LineNo, Total

USING STRCAT(cs-uri-stem, REPLACE_IF_NOT_NULL(cs-uri-query, STRCAT('?',
cs-uri-query))) AS QryStr,

TO_LOWERCASE(EXTRACT_TOKEN(QryStr, 0, '|')) AS Uri,

EXTRACT_TOKEN(cs-uri-query, 2, '|') AS ErrorCode,

EXTRACT_TOKEN(cs-uri-query, -1, '|') AS ErrorMsg,

EXTRACT_TOKEN(cs-uri-query, 1, '|') AS LineNo,

COUNT(*) AS Total

FROM %source%

WHERE

(cs-uri-stem LIKE '%.asp')

AND

(sc-status = 500)

GROUP BY Uri, ErrorCode, ErrorMsg, LineNo

ORDER BY Total DESC

---Ch02AspErrors.sql---




--
Regards,
Bernard Cheah
http://www.microsoft.com/iis/
http://www.iiswebcastseries.com/
http://www.msmvps.com/bernard/
 
J

Juan T. Llibre

Thanks for sharing this material, Bernard!





Bernard Cheah said:
I'm not sure about asp.net as it has its own error handling routine and only log status
code and minor info in IIS.
Unlike ASP engine, which it logs more info in the IIS log file. I wrote this chapter in
the Log Parser 2.2 book.
Chap2 - Monitoring IIS
http://www.iis-resources.com/downloads/LPChap2.zip

from:
----
Under normal circumstances, these type of errors are often caused by coding error in the
server-side query, for example, |12|800a0009| Subquery_out_of_range:_'arrayA(...)'. This
error indicates that the arrayA defined in in a server-side query is out of range. The
format normally starts with a pipe character followed by a line number, another pipe
separator, the error code, and finally one last pipe separator with an ASP error
message.

----

and here's the query for parsing ASP 500 related error.
---Ch02AspErrors.sql---

SELECT

Uri, Errorcode, ErrorMsg, LineNo, Total

USING STRCAT(cs-uri-stem, REPLACE_IF_NOT_NULL(cs-uri-query, STRCAT('?',
cs-uri-query))) AS QryStr,

TO_LOWERCASE(EXTRACT_TOKEN(QryStr, 0, '|')) AS Uri,

EXTRACT_TOKEN(cs-uri-query, 2, '|') AS ErrorCode,

EXTRACT_TOKEN(cs-uri-query, -1, '|') AS ErrorMsg,

EXTRACT_TOKEN(cs-uri-query, 1, '|') AS LineNo,

COUNT(*) AS Total

FROM %source%

WHERE

(cs-uri-stem LIKE '%.asp')

AND

(sc-status = 500)

GROUP BY Uri, ErrorCode, ErrorMsg, LineNo

ORDER BY Total DESC

---Ch02AspErrors.sql---




--
Regards,
Bernard Cheah
http://www.microsoft.com/iis/
http://www.iiswebcastseries.com/
http://www.msmvps.com/bernard/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top