ASP.NET Page Logging

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

I have an ASP.Net page that receives batch transmissions of data from
clients. I would like to add some type of logging to this application so I
can review transmission issues easily. I tried writing to a file but
quickly found when multiple clients are hitting the web page at the same
time it causes all kinds of issues with multiple threads trying to use the
same file. I was wondering if anyone has a solution they would like to
share and any type of sample would be wonderful.

Thanks,

Matt
 
What sort of events do you want to record? For low frequency events
you could queue up events and write them to a file in a synchronized
method. You could also consider writing them to a database table.

For exception monitoring, writing to the Windows event log or sending
an email are good options.

For high frequency events consider using performance coutners. You can
view these in perfmon while the application is running.
 
Anders,

Could you expand on this subject a little? I mean do you know where I can
get more information or some samples? I like this concept.

Thanks,

Matt
 
The MSDN documentation should cover the basics to get you started :

Collection of "Diagnostics"-related samples :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpqstart/ht
ml/cpsmpnetsamples-howtodiagnostics.asp

Specific sample using the TextWriterTraceListener :
http://go.microsoft.com/fwlink/?linkid=3268&url=/quickstart/howto/doc/trace.
aspx

Also check out :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdiagnosticstextwritertracelistenerclasstopic.asp

Tor Bådshaug
tor.badshaug [//at\\] bekk.no.

....
 

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

Back
Top