Sean Legassick <[EMAIL PROTECTED]> writes: > On Tue, Feb 13, 2001 at 09:23:24AM +0000, Sean Legassick wrote: > > On Mon, Feb 12, 2001 at 10:57:45PM -0800, Daniel Rall wrote: > > > That sounds good to me. I would like it to act like the standard > > > logger (log to file), but email an address the output of ERROR level > > > logging statements (or perhaps configurable, where DEBUG would email > > > all logging statements). > > > > That was exactly what I had in mind. I'm just going to look into whether > > I modify Log4JLogger to do it before rolling my own... > > Which was the right way to go - log4j already has email facilities, so > I've added an 'email' destination to the LoggingService, and > Log4JavaLogger implements it. There is an example in TR.properties that > should be self-explanatory. > > At the moment I've just gone with the log4j functionality which involves > keeping a buffer of log messages which only gets emailed when an ERROR > level event is logged. This is close to what you (and I) wanted, so I > left that as it means that INFO logs still go to the file. > > What I'd like to do now is implement a simple filter facility so that I > can stop getting hundreds of 'Broken pipe' exceptions emailed to me just > because someone decided to stop loading a page. I'm not quite sure yet > whether it would be better to make this specific to the email > destination, or general to a logging facility. > > In either case it would be a simple matter of specifying a class that > implements a LogEventFilter interface which takes the event (message + > throwable + logLevel) and returns a boolean to indicate whether to go > ahead and log it. That sounds terrific. -- Daniel Rall <[EMAIL PROTECTED]> ------------------------------------------------------------ To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/> Problems?: [EMAIL PROTECTED]
