Dblog is a handy module as it allows one to see issues in a single place, filter, sort, etc. It is also especially handy if you run multiple web heads. However, it is also prone to hammer your database server with requests and make it cry uncle--especially if PHP notices are enabled and there is some bad code living on your site.
Enter the ability to filter log entries *before* they go into dblog. This patch adds two fields to the error logging config page where you pick what severity levels you want to allow into the watchdog table as well as what types you want to allow into the watchdog table.
Any new log types are automatically allowed and have to be deliberately deselected. Also, by default, all severity levels are allowed. Because of this I feel that it can be slipped into 7.x because its default config does not alter Drupal's default behavior.
Also, one other thing in here is the index of the severity column in the watchdog table. If we're filtering by it (possibly exclusively) then we should have an index on it.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | dblog-1295182-14.patch | 4.11 KB | bryanhirsch |
| #13 | dblog-1295182-13.patch | 3.97 KB | bryanhirsch |
| #7 | dblog_1295182.patch | 3.99 KB | soyarma |
| #5 | dblog.patch | 4.49 KB | soyarma |
| #1 | dblog.patch | 4.49 KB | soyarma |
Comments
Comment #1
soyarma commentedNon borked patch file attached.
Comment #2
soyarma commentedGo forth and test, test bot
Comment #3
anavarreSubscribe
Comment #5
soyarma commentedOops, in recreating the patch I inadvertently called the watchdog table dblog :S. Fixed.
Comment #7
soyarma commentedComment #8
gcassie commentedInstead of
variable_get('dblog_allowed_severities', array(0,1,2,3,4,5,6,7));how aboutvariable_get('dblog_allowed_severities', watchdog_severity_levels());?Comment #10
soyarma commented#7: dblog_1295182.patch queued for re-testing.
Comment #11
soyarma commentedI believe that watchdog_severity_levels() returns the array with 0-7 as the keys and the names as the values. What I need is 0-7 as the values at that point.
Comment #12
bryanhirsch commentedsoyarma, re gcassie's suggestion, instead of:
how about:
Comment #13
bryanhirsch commentedThis patch includes changes proposed in comment #12.
I also noticed inconsistency in use of dblog_allowed_severity v. dblog_allowed_severities. I fixed this too.
Here are some UX issues which probably need some attention:
https://skitch.com/bryan.hirsch/g3qga/logging-and-errors-contrib7.dev
Comment #15
bryanhirsch commentedThis patch resolves the UX issues I raised in #13.
Comment #17
bryanhirsch commentedClosing, marking as duplicate. Work on this should be moved to 1408208. If anyone disagrees, please reopen.
As I explained here, http://drupal.org/node/1408208#comment-5480994, resolving this issue for dblog and syslog separately doesn't make sense. Both modules form_alter the same System module form. Both modules need this same functionality. Fixing these separately will inevitably lead to inconsistent patterns in the UI and bad UX. My most recent patch is posted with issue 1408208, including all the stuff in patches here, resolutions to UX issues from the skitch in comment #13, and the same functionality for Syslog module.