I have created a patch to include a new feature: The option to log only from a certain severity level. On the settings page you get an extra select list from which a user can choose a level to log from. everything higher than that level well be logged. Everything lower won't be logged.
This is an option that is also available in the core dblog module.
I think it is very handy for production sites for example, where you only want to log a real error, not al the info and notes.

Comments

wannesderoy created an issue. See original summary.

fgm’s picture

These are ongoing core issues to apply this to all loggers, might be better to have them there than here ?

#1268636: Watchdog should ignore reports below the system reporting level (2011 !) #1408208: Enable users to determine which types of log messages get written to dblog/syslog. Right now it's all or nothing.

Although, to be honest, this feature exists in mongodb_watchdog (https://fgm.github.io/mongodb/modules/mongodb_watchdog/ see watchdog_limit on that page) because I got tired of waiting for acceptance of #1268636 since 2011.

wannesdr’s picture

Aha, I didin't know this was an ongoing feature request for all loggers. But in the mean time the patch exists for those who want it. And maybe it can be added to a next release of redis_watchdog, just until it is added in core.

wannesdr’s picture

StatusFileSize
new6.43 KB

I noticed I missed a use statement for the RfcLogLevel class, updated the patch.

fgm’s picture

FWIW, there's been a similar settings in mongodb_watchdog 8.x-2.x (and 7.x-1.x) for several years.

loparev’s picture

I think a lot of other modules have similar settings as well, so if (or when) the patch will be applied to the core all of them should be updated in order to get rid of duplicated functionality.