Google-Apps
Hauptmenü

Post a Comment On: the urban canuk, eh

"log4net Configuration made simple through Attributes"

6 Comments -

1 – 6 of 6
Blogger Unknown said...

if you use log4net so often, I was wondering with witch viewer do you use?

11:20 AM

Blogger bryan said...

Hmmm, good question. Oddly enough, now that I think of it, I can't claim that I have a favorite tool for log4net! I think that's largely because of two reasons:

1. the framework is so extensible that I tailor my configuration to suit my project's needs. I've used smtp, udp, database, console, trace, event logs and rolling file appenders in some shape or form, either alone or in combination with one another. The type of project will also dictate logging requirements, ie console app versus Windows Service versus 20 load balanced web-servers...

2. my logging needs change at different stages of the project. During development, I pipe debug information to files and console windows mainly to see that the information is getting logged as expected (correct values, order, occurrence); During QA emphasis shifts to make sure logs contain meaningful data when errors occur; in Production, I want to be notified when problems occur via email, snmp, rss, etc.

Personally, I use Notepad++ for the majority of simple log file viewing.

The main challenge with file-based readers is how they deal with content that has line-breaks (Stack Traces, rtf, xml nodes, etc) -- this type of content often is interpreted as several rows instead of a single record. If you solve this problem, then any reader will do: Excel, LogParser, etc. Stay tuned, sounds like another blog post.

11:02 PM

Blogger Unknown said...

did I spell 'witch' ?? :-)

Anyway, I'm using log4net quite extensively as well. In my current project, I have services oriented architecture and to monitor them I use the udp appender to one centralized viewer.
I tried at first 'Chainsaw', but I really didn't like the execution of it (it's java and requires to have an annoying console window, moreover the configuration of it wasn't so nice. Lately I found 'Log4View' and currently it works smoothly and suits my needs. The only problem that it's not free. It's kinda weird that the log4net library quite widely used, and there's no free worthy viewer!

anyway, thanks for your help, I'm gonna keep an eye on your posts :-)

4:02 AM

Blogger bryan said...

Just an update...

I've got a post that demonstrates how to create excel friendly log4net output: Producing readable log4net output

12:11 PM

Blogger Christian said...

@shlomik
you can use my unix-like tail implementation.
1. it's free
2. it's easy to install (click-once)

get it here whenever you need it:

http://www.connexin.ch/cxntail

cheers
Christian

4:18 AM

Blogger Niels Brinch said...

Thanks.

If you can spare the performance, nothing really beats logging to the database, so you get a source that's easily searchable.

In case you some times forget to put the right class name when setting up log4net for a specific class, you can use this declaration instead.

private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

2:23 AM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot