Configurable log sampling via $wgDebugLogGroups
authorOri Livneh <ori@wikimedia.org>
Tue, 5 Nov 2013 19:42:49 +0000 (11:42 -0800)
committerOri Livneh <ori@wikimedia.org>
Tue, 5 Nov 2013 19:49:42 +0000 (11:49 -0800)
commit2c25e14642b8cfb87e57caf11c2d0c2f3e6a1203
treea45a6fd62e26819e9d08a97c0d72cc24cc3f1b3e
parent0d1beb5d1316dd85c1125476fdf886fbd7c2ca0d
Configurable log sampling via $wgDebugLogGroups

Make it possible to configure a log-group-specific sampling factor by allowing
$wgDebugLogGroups values to be associative arrays with 'destination' & 'sample'
keys.

The immediate use-case I have in mind is the memcached log, which is too
verbose to enable in production. We could sample on the receiving end, but
doing so would not help MediaWiki, which would still be on the hook for
processing and dispatching every single record.

Idea was vetted by Dr. Manhattan:

<TimStarling> I think you could have each element in $wgDebugLogGroups be an
  associative array
<TimStarling> e.g. array( 'sample' => 1000, 'target' => "$host:$port")
<TimStarling> that would allow for more features to be added to it in
  future

Change-Id: Ib0ece5d5d9c2aadef13b77ac38995b0e47ac086f
includes/DefaultSettings.php
includes/GlobalFunctions.php