+1 for log4net. You add simple logging statements to your code and do most of the rest in the .config file. The config file decides where the output is going (SQL table, Event log, text file, network stream, etc...) as well as deciding the logging level and whether logging is actually turned on.
Log4net is a very easy way to add logging to your application. I know MS has the EIF application block which has some logging, but do your research. I recall seeing a blog post that EIF is noticeably slower the log4net -- but I can't recall the URL right now. --- Patrick Steele Microsoft .NET MVP http://weblogs.asp.net/psteele/ > -----Original Message----- > From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma > Sent: Thursday, August 25, 2005 10:31 AM > To: [email protected] > Subject: Re: [ADVANCED-DOTNET] Writing code for Debugging > > > > I've been given the task of coming up with a standard for > our new app > > for help in debugging the code when a client calls in and has a > > problem. So far, all I can think of is to log all variable > values at > > the beggening of all functions and logging the output of all > > functions. Also logging all screen data (if grid, only > current row). > > > > Questions: > > > > 1) What have you done in the past to help debugging? > > > > 2) Is there a better way then my idea above? > > Yes, look into trace switches and listeners. You can > make life easier with a library like Log4Net for example > which has a lot of different fine grained trace listeners on > board. The main thing is that trace switches can be turned on > or off with a .config file, and the output receiver can also > be configured in the config file. This means that you don't > have to recompile a build for your customer to enable logging > of data at runtime. > > Enabling tracing is very simple, the .NET > documentation has a lot of info on this (tracing, trace > listeners, trace switches). Also log4net has extra > documentation if you want to use log4net for this (you can > use the default .NET build in tracing) > > Frans > > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
