Manual:$wgDebugLogGroups
Appearance
| デバッグ: $wgDebugLogGroups | |
|---|---|
特定のグループの wfDebugLog() の出力先を $wgDebugLogFile 以外のファイルに変更する。 |
|
| 導入されたバージョン: | 1.5.0 (r10598) |
| 除去されたバージョン: | 使用中 |
| 許容される値: | (記録グループ キーからファイル名への連想配列) |
| 既定値: | [] |
| その他の設定: アルファベット順 | 機能順 | |
詳細
記録グループ キーからファイル名への連想配列を設定します。
If set, wfDebugLog() output for that group will go to that file instead of the regular $wgDebugLogFile.
Useful for enabling selective logging in production.
If a group is configured in
$wgDebugLogGroups, then all debug messages with the according group key will be logged to that file, also if $wgDebugLogFile is not set! With other words: If a group key is configured in $wgDebugLogGroups, messages will be written, even if an empty value of $wgDebugLogFile generally disables debugging.Log destinations may be one of the following:
- false to completely remove from the output, including from $wgDebugLogFile.
- string values specifying a filename or URI.
- associative array with keys:
destination- desired filename or URI.sample- an integer value, specifying a sampling factor (optional)level- A\Psr\Log\LogLevelconstant, indicating the minimum log level (optional, since 1.25)
When $wgMWLoggerDefaultSpi is set to a non-default value, $wgDebugLogGroups will probably be ignored, and the method of configuring log files will be determined by whatever logging system is invoked by $wgMWLoggerDefaultSpi.
例
この例では、グループ「ConfirmEditExtension」のデバッグ メッセージは「debug-ext_confirmedit.log」に、「SpamRegex」のデバッグ メッセージは「debug-spam.log」に、それぞれ出力されます。
$wgDebugLogGroups = [
'ConfirmEditExtension' => $IP . '/../../home/debug-ext_confirmedit.log',
'SpamRegex' => $IP . '/../../home/debug-spam.log',
];
例:
$wgDebugLogGroups['redis'] = '/var/log/mediawiki/redis.log';
高度な例:
$wgDebugLogGroups['memcached'] = [
'destination' => '/var/log/mediawiki/memcached.log',
'sample' => 1000, // log 1 message out of every 1,000.
'level' => \Psr\Log\LogLevel::WARNING,
];
$wgDebugLogGroups['redis'] = [
'destination' => '/var/log/mediawiki/redis.log',
// Level can also be the literal string value of any Psr\Log\LogLevel constant
'level' => 'info',
];
- Multiple log groups in a single file
- You might want to setup a temporary configuration like the following to see all authentication related logging to trouble-shoot authentication.
$wgDebugLogGroups['cookie'] =
$wgDebugLogGroups['session'] =
$wgDebugLogGroups['SimpleSAMLphp'] =
$wgDebugLogGroups['PluggableAuth'] = "$IP/cache/PluggableAuth.log";
Some common debug log groups
exception,error,fatal,silenced-error- エラーdeprecated- 非推奨の警告objectcache,caches,memcached/SQLBagOStuff- キャッシュrdbms- データベース (including, if $wgDebugDumpSql is set, all DB queries)cookie- 返答のクッキーexec- shellのコマンドsession- SessionManagerauthentication,login- AuthManagerratelimit,throttler- hitting rate limits ($wgRateLimits and other)resourceloader,ResourceLoaderImage- ResourceLoaderhttp,HttpError- HTTP requests to external services (via theHttp/MwHttpRequestclasses)api- APIthumbnail,fileupload,fileconcatenate- 画像関連runJobs- ジョブ キューparser,ParserCache- パーサーslow-parse- warnings about pages that take long to parse
Other debug log groups
squidlocalisationgitinfoUserOptionsManagerMimeOldRevisionImporterMessageCacheGlobalTitleFailDeferredUpdatesContentHandlerBlockManagerMediaHandlerFactory