If you can afford to throw away the events, a CountingFilter would solve this in a snap. CountingFilter does not exist. You'd have to write it. Here is a recipe:
1) Attach the counting filter to DBAppender (or any appender for that matter)
2) Have CountingFilter count the number of incoming events per second and throw away excess events.
If you want to keep the events by deferring them into an adjacent timeslot, then that's a much more difficult problem. In most cases, deferring execution does not lead to a more stable system but to a more complicated one. My suggestion would be to improve the performance of DBAppender by using a pooled connection.
Keep it simple. If you can't keep it simple, don't bother.
If you insist, then you could modify AsyncAppender to serve at most N events by second by introducing a delay in its main loop.
HTH,
At 02:45 PM 6/17/2004, Scott Deboy wrote:
I'd first look to see if there are other ways of addressing the issue. Maybe asyncAppender alone would help.
A custom filter (which performed a wait when evaluating the event), in combination with asyncAppender, might work.
Don't forget that asyncAppender uses a bounded buffer.
-----Original Message----- From: James Stauffer [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 15, 2004 10:17 AM To: '[EMAIL PROTECTED]' Subject: DBAppender throughput limits
Is it possible to make DBAppender (or other appenders) limit the number of logs that they write. e.g. Write no more than 10 logs/sec.
James Stauffer
-- Ceki G�lc�
For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
