<commit_before># <?php

$wgDebugTimestamps = false;
$wgDBerrorLog = true;

$wgMWLoggerDefaultSpi['args'][0]['loggers']['@default']['handlers'][] = 'what';
$wgMWLoggerDefaultSpi['args'][0]['handlers']['syslog'] = [
	'class' => '\\MediaWiki\\Logger\\Monolog\\SyslogHandler',
	'args' => [ 'mediawiki', '127.0.0.1', 10514 ],
	'formatter' => 'logstash',
];
$wgMWLoggerDefaultSpi['args'][0]['handlers']['what'] = [
	'class' => '\\Monolog\\Handler\\WhatFailureGroupHandler',
	'args' => [
		function () {
			$provider = \MediaWiki\Logger\LoggerFactory::getProvider();
			return array_map( [ $provider, 'getHandler' ], [ 'syslog' ] );
		}
	],
];
$wgMWLoggerDefaultSpi['args'][0]['formatters']['logstash'] = [
	'class' => '\\Monolog\\Formatter\\LogstashFormatter',
	'args'  => [ 'mediawiki', php_uname( 'n' ), null, '', 1 ],
];
<commit_msg>Use custom LogstashFormatter<commit_after># <?php

$wgDebugTimestamps = false;
$wgDBerrorLog = true;

$wgMWLoggerDefaultSpi['args'][0]['loggers']['@default']['handlers'][] = 'what';
$wgMWLoggerDefaultSpi['args'][0]['handlers']['syslog'] = [
	'class' => '\\MediaWiki\\Logger\\Monolog\\SyslogHandler',
	'args' => [ 'mediawiki', '127.0.0.1', 10514 ],
	'formatter' => 'logstash',
];
$wgMWLoggerDefaultSpi['args'][0]['handlers']['what'] = [
	'class' => '\\Monolog\\Handler\\WhatFailureGroupHandler',
	'args' => [
		function () {
			$provider = \MediaWiki\Logger\LoggerFactory::getProvider();
			return array_map( [ $provider, 'getHandler' ], [ 'syslog' ] );
		}
	],
];
$wgMWLoggerDefaultSpi['args'][0]['formatters']['logstash'] = [
	'class' => '\\MediaWiki\\Logger\\Monolog\\LogstashFormatter',
	'args'  => [ 'mediawiki', php_uname( 'n' ), null, '', 1 ],
];

{'fraction_non_alphanumeric': 0.25430778371954843, 'fraction_numerical': 0.019013666072489603, 'mean_word_length': 5.817813765182186, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5824643', 'n_tokens_mistral': 670, 'n_tokens_neox': 627, 'n_words': 78}