views:

428

answers:

2

A good friend of mine works for a large asp.net shop, with a web farm with many web servers (dozens). The application logs exceptions and messages to the event log on each box (not to a centralized location).

Does anyone know of a convenient way to perform unified reporting on event logs on a number of different boxes?

Or, which is better: - write tools that connect to each event log on each box? - change architecture to log events to the database? - some other mechanism I haven't considered?

+1  A: 

I would use Log4Net (or something similar) for the logging, saving the files to disk, and rotating log file periodically. (I'm not a big fan of the Windows event log, personally.) Then have a background service on each box which uploads the log file into a database table - keeping track of which log entry came from which box.

This gives simple searching over the whole web farm while maintaining the information about which log entry came from where.

Similar questions:

Jon Skeet
A: 

Members of my ASP.Net development team are enthusiastic users of the free software from BareMetal called Bare Tail to read plain text log files when they need to quickly determine the source of a production issue. I believe that you can read from multiple files at the same time (on different tabs).

You could still upload the log file data to a database, if desired. But, writing to and reading from a local log file is much faster and simpler than writing to a database. And, once a web app is stabilized in production, the most likely source of exceptions may well be loss of the database connection. One way around that is to try to write to the database, and if that fails, write to a log file. You could then use a tool like this to more easily read the log file data.

DOK