Bumping monolog from 1.25.3 to 2.0.2 (T242751) we had to further modify the output of the base LogstashFormatter to save a breaking change
From the changelog
- Context/extra data are now sent as an object instead of single keys
This meant that entries that previously would've ended up prefixed (because they duplicated/overwrote existing keys) now ended up in objects, rather than "$prefix$key" in the base array
To save causing this breakage, the code was imported from 1.25.3 that kept the original format (https://github.com/Seldaek/monolog/blob/1.25.3/src/Monolog/Formatter/LogstashFormatter.php#L130-L165), however this brings on additional Technical-Debt as a maintenance burden, for any further upstream changes et al need copying in, as well as special casing MediaWiki
A longer term plan should be worked out and implemented to remove this special casing, and how we deal with this in logstash... A patch like https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/579682/ does that removal, but doesn't update the indexing and such on the logstash side