Page MenuHomePhabricator

Allow post-initialization configuration of MonologSpi
Closed, ResolvedPublic

Description

The current implementation of the MediaWiki\Logger\MonologSpi does not provide a mechanism for altering the configuration data or underlying Monolog system after the initial creation of the object. This makes runtime conditional logging changes essentially impossible.

Currently there have been two use cases identified where this behavior would be useful in the WMF production cluster:

  • Historically it has been useful to debug Wikitech LDAP issues with local file logging on the Wikitech server. Thus far we have not been able to devise a method of adding to the Monolog configuration to allow this.
  • Sending metrics to statsd to track time rate of change for interesting events could be implemented by adding structured logging in appropriate places to the codebase and attaching a custom Monolog Handler to the appropriate logging channels. For installations not wishing to use Monolog and/or statsd these events would still be available to the logging layer for recording in a file or other data sink.

Event Timeline

bd808 claimed this task.
bd808 raised the priority of this task from to Medium.
bd808 updated the task description. (Show Details)
bd808 added a project: MediaWiki-Debug-Logger.
bd808 subscribed.

Change 222501 had a related patch set uploaded (by BryanDavis):
MonologSpi: Add method to provide additional configuration

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

Change 222501 merged by jenkins-bot:
MonologSpi: Add method to provide additional configuration

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