Manual:Logging to Special:Log/ja

このページでは Special:Log に操作を記録する方法を示します.

1.19 以降
これは拡張機能用の例です. コアでも同様ですが、設定は DefaultSettings.php にあり、コアのメッセージは異なる場所にあります.

リンクの追加
To add a link to log entries, you should pass the page name etc. in the log parameters, and format that in your LogFormatter using. With other methods, non-html output (like UDP feed to IRC) will be broken.

See for an example LogFormatter with links.

1.19 より前
There are ways to use this system but make it forward compatible with the new system by using the message name format described above. Extra parameters are what are causing most of the issues. You can make the messages like above: And pass empty value for param $1, because the old system will prepend the username automatically; # for $2 to avoid automatic gender feature using the gender of the reader. Custom parameters should start at $4.

An example of adding a new log type called "foo" for your extension, using the LogPage class. In the MyExtension.php file, add:

Create system messages for your extension in MyExtension.i18n.php:

In the body file MyExtension_body.php, add this code, which adds entries in both Special:Log/foo and Special:RecentChanges:

If you don't want your events to show up in Special:RecentChanges, which might cause watchlist notifications, change the constructor to:

関連項目

 * Manual:$wgLogRestrictions
 * Bug 24620 – Log entries are difficult to localize; rewrite logs system