Question

Is it possible to somehow increase the severity of a log entry if it repeats in a certain time period?

We got repeatedly coming exceptions in our system, that are not critical on their own, but if they suddenly increase in frequency, we want to get notified immediately.

Was it helpful?

Solution

You could try my answer (or some variation of it) here:

log4net - any filter for logging only the Nth message?

The questions asks how filter frequently occurring log messages so that only every n-th one gets logged (configurable). I proposed using a custom filter implementation that filters messages that occur frequently in a short period of time.

In your case you could ignore messages that meet a certain pattern unless they occur frequently. You might configure a second appender (like email) and use the filter there. In your "normal" log, just accept all log messages. In the "emergency" log, use the filter and only trigger an email when the message pattern meets a certain criteria.

Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top