Page MenuHomePhabricator

Improve logging of MediaWiki DB errors
Open, Needs TriagePublic


DB error logging in MediaWiki should make better use of structured logging: neither the DB error message / code nor the method where the query was issued nor the sanitized query itself is available as a structured field. Providing those would allow charting the various error types (there is a low trickle of timeout-related DB errors all the time, it's hard to see currently which errors were made more frequent by a deploy as we cannot pivot on the error message), seeing the most frequent queries or issuing methods and it would be easy as they are already part of the error message (just not in a form that's useful for logstash processing).

Also the DBQuery channel does not have stack traces, and it is basically about logging DBError exceptions, which then also go to the exception channel (with stack traces but otherwise very nearly the same) which seems a bit unnecessary.