Page MenuHomePhabricator

All OAuth Logstash logs should include the consumer key
Closed, ResolvedPublic

Description

...including exceptions. They are not terribly useful right now.

Event Timeline

This was mostly done in rEOAUa17a9abf248f: Log additional error details. Not done for exceptions that originate in a library (OAuthException as opposed to MWOAuthException for OAuth 1; not sure how much the OAuth 2 library uses exceptions) but I think those are relatively rare.

Tgr renamed this task from All OAuth logs should include the consumer key to All OAuth Logstash logs should include the consumer key.Dec 18 2025, 1:22 PM

Change #1310224 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/OAuth@master] Update all ->info() and ->warning() calls with consistent consumer info

https://gerrit.wikimedia.org/r/1310224

Change #1310226 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/OAuth@master] Make MWOAuthException log consistent consumer info

https://gerrit.wikimedia.org/r/1310226

I reviewed all uses of ->info() and ->warning() for logging (which are the only log levels I see logged in production), and all uses of new MWOAuthException, and added consistent log context to them (using a new method on Consumer) whenever we have a Consumer object already available or can easily fetch it. I think this is thorough enough that we'll be able to confidently close this task.

Change #1310224 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] Update all ->info() and ->warning() calls with consistent consumer info

https://gerrit.wikimedia.org/r/1310224

Change #1310226 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] Make MWOAuthException log consistent consumer info

https://gerrit.wikimedia.org/r/1310226