Posted By: Blkbam | Sep 29th, 2005 @ 8:06 AM
page 1 of 1
Comments: 6 | Views: 6966
Blkbam
Blkbam
Bam, Bam! Bam, Bam Bam!
We're working on a new web service here at my job and still in the early stages.   Due to the requirments I can't run it and test it on my dev box, it has to be tested from a specific IP.  Since this is the case we have to log our attempts in some manner so we can read them and see what went wrong/right.

Which brings me to the question, How should we log?  I suggested the EventLog since it's structured already and easy to read.  Of course one response I got back was it could crash the server if it got full.  I've never actually seen this happen.  Many programs and apps use the Eventlog with no problems what so ever.

Another suggestion was the good old flat file in some semi-structured way.  I hate reading those logs because of the structure, ease of use and opening and searching 5MB text file is a pain, so I'm not really for that idea but it could happen.

Already out is the database and xml format due to reliablilty so I ask you guys,  how do you log Web/Windows Services?

Raj Tripathi
Raj Tripathi
Respect My Authority!

Hi, check out log4net.

log4net is a tool to help the programmer output log statements to a variety of output targets. log4net is a port of the excellent log4j framework to the .NET runtime.

I use it in all my "layers" including the Web Service. It's great.

Have you considered using the Enterprise Library?  It is excellent for logging and you can easily configure it to log to different sources if the requirements should change.

writing to the Windows built-in event log of course!

and I can't think of a reason why you can't test on your own machine, any program should always be generic/configurable enough that you an take it from one place to another, change the configuration and be good to go
Yggdrasil
Yggdrasil
Pour me a cab, 'cause I can't drink no more.

The event log can be configured in three different ways to react to being full - recycle by size, recycle by date and don't recycle at all.
If you set it to recycle by size, and give it a decent enough size (10MB should be plenty) you can have event logs going back quite a while, without worrying about the server.

mrichman
mrichman
Mark A. Richman
Raj Tripathi wrote:

Hi, check out log4net.

log4net is a tool to help the programmer output log statements to a variety of output targets. log4net is a port of the excellent log4j framework to the .NET runtime.

I use it in all my "layers" including the Web Service. It's great.



Same here...works like a champ!
page 1 of 1
Comments: 6 | Views: 6966
Microsoft Communities