473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP.NET Page Logging

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

Nov 18 '05 #1
6 1520
Matt,

Try using asynchnous web service calls to log pages into a database.

"Matt" wrote:
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

Nov 18 '05 #2
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 19 Nov 2004 12:29:09 -0800, "MikeL"
<Mi***@discussions.microsoft.com> wrote:
Matt,

Try using asynchnous web service calls to log pages into a database.

"Matt" wrote:
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


Nov 18 '05 #3
Use the System.Diagnostics.Trace.Write method to log messages and register a
TextWriterTraceListener to write the log entries to a file.

Anders Norås
blog: http://dotnetjunkies.com/weblog/anoras
Nov 18 '05 #4
Event log & tracing seem easy to me. You could also consider using
http://logging.apache.org/log4net/ , which is a fleshed out logging
component you can use in your applications. Free.

--
Ben Strackany
www.developmentnow.com

<a href="http://www.developmentnow.com">dn</a>
"Matt" <md*****@sorvive.DONT-SEND-SPAM.com> wrote in message
news:uH**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #5
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

"Anders Norås" <an**********@objectware.no> wrote in message
news:e4**************@TK2MSFTNGP10.phx.gbl...
Use the System.Diagnostics.Trace.Write method to log messages and register a TextWriterTraceListener to write the log entries to a file.

Anders Norås
blog: http://dotnetjunkies.com/weblog/anoras

Nov 18 '05 #6
The MSDN documentation should cover the basics to get you started :

Collection of "Diagnostics"-related samples :
http://msdn.microsoft.com/library/de...us/cpqstart/ht
ml/cpsmpnetsamples-howtodiagnostics.asp

Specific sample using the TextWriterTraceListener :
http://go.microsoft.com/fwlink/?link...owto/doc/trace.
aspx

Also check out :
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdiagnosticstextwritertracelistenerclass topic.asp

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

....
Use the System.Diagnostics.Trace.Write method to log messages and register
a TextWriterTraceListener to write the log entries to a file.


Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jjesso | last post by:
I am trying to add a new logging level. logging.config.fileConfig("bengineLog.cfg") logging.CLIENT = logging.INFO + 1 logging.addLevelName( logging.CLIENT, 'CLIENT' ) logging.root.setLevel( )...
2
by: swp | last post by:
I have a site created using ASP, HTML, and JavaScript. I use frames to manage a few things, and requires SSL to connect. The site is on a secured network, not meant to be cross-browser...
0
by: Karuppasamy | last post by:
H I am trying to use the Logging Module provided by Microsoft Application Blocks for .Net I installed everything as per the Instructions given in the 'Development Using the Logging Block' ...
6
by: pmatos | last post by:
Hi all, I am trying to create a simple but efficient C++ logging class. I know there are lots of them out there but I want something simple and efficient. The number one requirement is the...
6
by: Sean C. | last post by:
Helpful folks, I am having a hard time figuring out how to reduce my percentage of dirty page steal activity. Below are statistics for three fairly normal days, with the bufferpool hit ratios...
7
by: Jean-David Beyer | last post by:
I have six hard drives (4 SCSI and 2 EIDE) on my main machine with parts of a database on each drive. The main index is on one SCSI drive all to itself. The main data are on the other three SCSI...
7
by: Alan Silver | last post by:
Hello, Sorry this is a bit wordy, but it's a pretty simple question... I have a web site, http://domain/ which is a public site, part of which (http://domain/a/) is protected by forms...
0
by: robert | last post by:
As more and more python packages are starting to use the bloomy (Java-ish) 'logging' module in a mood of responsibility and as I am not overly happy with the current "thickener" style of usage, I...
1
by: Tom Kearney | last post by:
Hi - I'm trying to use "Microsoft.VisualBasic.Logging.FileLogTraceListener" from a set of C# aspx web pages, but I can't seem to use: <%@ Import Namespace="Microsoft.VisualBasic.Logging" %> I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.