[Clockwork-developers] Logging
Status: Planning
Brought to you by:
jlouder
|
From: Joel L. <jo...@lo...> - 2003-02-23 00:19:27
|
Shawn McMahon and I had a conversation weeks ago about logging. Depending on how our users do their monitoring, they may need our software to log to any number of different formats/destinations. Shawn came up with a pretty comprehensive list: * file * syslog * SNMP trap * Windows event log That should satisfy just about everyone. I can't imagine anyone who's serious about monitoring their hosts and applications not being able to pick up error messages from at least one of those sources. The user should be able to configure multiple logging destinations, and set a minimum severity for each. For example, it should be possible to configure logging like: + DEBUG or higher -> /var/log/clockwork.log + INFO or higher -> syslog + WARNING or higher -> send as SNMP trap Having different places to log, each with their own semantics for severity, will require some abstraction so that Clockwork can log to a common logging API, and that thing can figure out how to translate it to the API of a particular backend. Luckily, the nice folks at Apache's Jakarta project have already done just this with the Commons Logging component. It's described as "an ultra-thin bridge between different logging libraries." They have created the common logging API, and make it easy for you to write a little code that plugs in whatever backend you want to use to their logging framework. Incidentally, they've already got the "plug-in" for Log4J written, which handles file and syslog logging. So all that's left is SNMP traps and Windows event log. I did a little digging, and I'm afraid there's no way to do the Windows event log in pure Java -- a .DLL must be involved. If you're interested in doing some reading, here are a couple of references: http://jakarta.apache.org/commons/logging.html http://jakarta.apache.org/log4j/index.html -- Joel |