views:

25

answers:

2

I'm using MS Enterprise Logging Application Block in an ASP.NET website.

For production launch, I will set up a log listener in one of these locations:

  • Sql Server database
  • Windows event log
  • Text files

Which has the least impact on performance?

NB - I can't switch to Log4Net or ELMAH at this point, so please don't suggest that in your response.

A: 

Hi,

We use event log, and that doesn't seem to impact performance. I can't properly tell you the difference between each one... when it comes with a database, it depends. Is the database on the same machine, or a different machine? Is it half-way across the country?

Typically, the database is fast, but network latency can slow down the process. Disk IO is usually pretty fast too. Disk IO for logging can grow rapidly, and might not be the best option if you store all the logs in the same file.

Plus, consider accessibility, which one is easier to access without having to access the machine. The database would be a choice candidate in that category...

HTH.

Brian
Database is on the same switch as web servers.
frankadelic
Regarding disk IO -- isn't event log ultimately stored on disk?
frankadelic
One more - how do you handle accessibility to the event log? Can you ship the event log to another machine outside the production environment?
frankadelic
Database on the same server would be pretty fast, but does require some testing on your part to determine what the speed would be. Event log is on disk, but managed by the event manager. I'm not sure if you can ship it, that's why I mentioned the last statement about access. If you use disk IO, you have to write it to the disk, either with XML, CSV, etc.
Brian
A: 

SQL would give you the most flexibility for reporting. If you have a beefy DB setup and fast network, it might not put much additional perfroamcne burden on you over text files.

OTOH, if you're not planning on doing much log analysis, just looking at logs on rare occassions to figure out what lead to a problem, then text files are simpler to set up and manage.

Event log is ok, but if you're going to use it, consider using it only for significant errors, don't clutter it up with a bunch of unimportant messages. Use it in conjunction with SQL or text files with those significant errors logged to both locations.

Whatever you decide, test it for performance before going into production.

Jay Cincotta