Kevin
Kevin

Reputation:

.Net 3.5 Logging

I'm a pretty new C# programmer. I was wondering if someone can fill me in with more information on how to use a logging Framework into a already existing solution (if that's what you call it).

I am trying to get logging for my Project i am doing. I was wondering what good & easy frameworks there are and how are they supposed to be implemented? Should I research a specific topic? I haven't found much tutorials or anything. So if anyone has any suggestions or ideas that can lead me to the right way. I would really appreciate it.

Also Just wondering. I am using .Net 3.5 Since Log4Net is using .Net 2.0... Is there any conflicting/ will it slow it down or anything?

Upvotes: 3

Views: 4450

Answers (9)

Jay Cincotta
Jay Cincotta

Reputation: 4386

Take a look at GIBRALTAR. It's a great logging tool that combines the goodness of ELMAH, log4net, perfmon and other tools in one very nice package. It works for desktop or ASP.NET applications and is very easy to integrate.

DISCLOSURE: I'm biased. I've been writing logging tools for 10 years and spent the last two years along with the other members of my mISV writing Gibraltar.

For a quick peek, check us out on YouTube.

Upvotes: 0

Ray Hayes
Ray Hayes

Reputation: 15015

To focus on this part of your question...

Also Just wondering. I am using .Net 3.5 Since Log4Net is using .Net 2.0... Is there any conflicting/ will it slow it down or anything?

No, there will be no conflict. .NET 3.5 is simply a superset of .NET 2.0. Applications written for .NET 3.5 will happily run using .NET 2.0 third party libraries (e.g. it is 100% compatible).

Upvotes: 0

dionysus55
dionysus55

Reputation: 149

If you are working with asp.net or asp.mvc you can try ELMAH. It is really nice and just plugs right into your website. Granted ELMAH only handles errors, and if you have more you want to log, I would use it in part with another logging framework. I tend to mix it with Log4Net.

Upvotes: 0

Sklivvz
Sklivvz

Reputation: 31163

I use (and write and maintain =D) the SixPack library, which includes a very easy to use logging framework. Example:

using SixPack.Diagnostics;

///

  Log.Instance.Add("Hello");

///

Upvotes: 0

madcolor
madcolor

Reputation: 8170

HTTPModule and your own function to spit it to a logfile/db. Works for me.

Upvotes: 0

Vinay Sajip
Vinay Sajip

Reputation: 99530

I would recommend log4net together with Common Logging. The latter allows you to plug in either log4net or the Microsoft Enterprise Library logging implementations.

Upvotes: 1

Satish
Satish

Reputation: 3100

You could try log4net or the logging application block from Microsoft Enterprise Library.

Upvotes: 0

Reed Copsey
Reed Copsey

Reputation: 564891

A very good logging framework, which allows for quite a bit of flexibility and easy integration, is Apache's log4net. It is nice in that it allows easy configuration of multiple, independent logging targets.

(The official site seems to be down - wikipedia has a good discussion about log4net.)

Upvotes: 7

Henri
Henri

Reputation: 5113

I use NLog for the moment.

It works great because you can output to almost any type of medium (database, file, messagebox, networkshare, console, etc etc) by just adjusting a xml file with settings.

It has also a lot of other nice features (log message levels like debug, info, error, etc). Just google for a comparison with other frameworks.

The only bad this is that is doesnt support aspect oreiented programming, so you have to put manual .Log() statements everywhere in the code.

Upvotes: 0

Related Questions