From: <msc...@ao...> - 2003-01-31 16:16:50
|
In a message dated 1/31/2003 1:58:03 AM Eastern Standard Time, "Dintelmann, Peter" <Pet...@Dr...> writes: >I am looking for a feature similar to syslog's "last message repeated N >times" in Log4perl. The intended use is for database connection modules >and the like. Sounds like a very useful feature to me. However, I haven't seen it anywhere in log4j's implementation, have you? Some random thoughts: The easiest way to implement it would probably be to have an appender taking care of buffering (similar to what Log::Dispatch::Email does now) and employing some logic to decide when to log (somewhat tricky, because you can't buffer forever and if you don't flush before the program ends, the messages are lost). On the other hand, this feature is generic enough to put it into some kind of (yet to be implemented) "output filter" which could be plugged between log4perl and any appender. Also, it could be implemented differently for sequential and random access appenders. In case of a database, you could just keep writing to the same row and increasing a count, while in case of a file appender, you'd have to have some external buffering with flush parameters. Thoughts anybody? -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |