Logging Service

Bruce Gruenbaum:
The Logging Service logs every event that takes place in the system that is set to be logged. On a Windows platform these logs are optionally written to the Event Log. Where such services exist on other platforms they are used as appropriate. Exceptions are automatically logged with their complete stack traces.

Thomas Mercer-Hursh
"set to be logged" seems to imply getting configuration data on what to log.

I suppose that it should be a choice, but I can't say that I am personally fond of dumping this sort of information into a generic OS log ... it should be someplace where it is more conspicuous.

This should also include an option for centralized logging. E.g., whenever an unhandled exception occurs, I want that to show up in a central location.

Initial content adapted from an exchange on PEG.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Logging locations

Thomas: I agree, there should be a choice of destinations, with the OS log being one of them (and not the default - unless your a windoze biggot). Something to consider might be the Exchange presentation I did in Orlando (was that 2006?). It had multiple destinations, the ability to change destination at runtime, the ability to auto-associate generated troubleshooting information such as propath, connected databases, stack trace, etc.

It was extremely simple for the programmer, one line of code per event to be logged. The level of detail to be logged was controlled by turning various message types/business transactions on/off. You could log to a central location, a session-based location, or both at the same time (great for correlating problems where the byplay between users is suspected in the cause).

It used the database for destination management, and that may be a problem for a generic service like this, but there are alternatives. It also cached the destinations so that it did not constantly hit the database to figure out where something should go.

It might be interesting to start with this as a base to build upon.

Glen


tamhas's picture

It might be interesting to

It might be interesting to start with this as a base to build upon

At the very least, it should be a good starting point, both for specifications and actual code.