August 18, 2007

Simple Tracing and Logging for Asp.Net and .Net Command Line Applications

Filed under: .Net,C++,PHP,Programming — pj @ 12:51 am

From time to time, I need some quick and dirty logging in my .Net applications.  I don’t always have time or energy to worry about the ideal logging API. The MSDN documentation and all the examples I found for the built-in .Net logging facilities were confusing and, it turns out, overkill.

Logging in Asp.Net

Logging in Asp.Net is confusing because Microsoft uses the word “trace” in two different contexts: (more…)

Logging for Services, GUI and Command Line Applications

Filed under: .Net,C++,PHP,Programming — pj @ 12:50 am

This is the first is a series of articles about logging. In this first article, I will describe what I believe is a simple, yet useful logging API. In later articles, I’ll give some hands on practical advise. As I continue the series, I’ll add links to the new articles here:

Wow, some programmers go crazy about logging.  Do a Google search for “.net logging” and you’ll see what I mean. Some of these libraries are huge.  While some applications may really need all the complexity these libraries offer, I have seen it severely abused on more than one occasion. Crank up a copy of Blackberry Enterprise Server (BES) and let it run for a week or two. You’ll find your Windows Event Viewer overflowing with all types of mysterious, confusing and generally useless messages.  In addition to the constant Event Viewer spew, if you let BES run unattended, you’ll eventually find that your BES hard drive is literally overflowing with many different log files all with obscure names and even more obscure contents.  Exchange Server has a similar problem where some logging is done in Event Viewer, other logging is done to text files. And none of the Exchange Server logging options ever seems to enable the simple email flow messages you need for common day to day administration tasks that I take for granted on our Linux email servers.

Is all this really necessary? (more…)

Powered by Teztech