Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F10770551
WithLog.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
WithLog.php
View Options
<?php
namespace
Nasqueron\SAAS\MediaWiki
;
trait
WithLog
{
public
static
function
enableLog
()
:
void
{
$GLOBALS
[
'wgMWLoggerDefaultSpi'
]
=
self
::
getLoggerConfiguration
();
}
private
static
function
getLogPath
()
:
string
{
return
"/var/log/mediawiki/error.log"
;
}
private
static
function
getLoggerConfiguration
()
:
array
{
// See https://www.mediawiki.org/wiki/Manual:MonologSpi
return
[
'class'
=>
'
\\
MediaWiki
\\
Logger
\\
MonologSpi'
,
'args'
=>
[[
'loggers'
=>
[
'@default'
=>
[
'processors'
=>
[
'wiki'
,
'psr'
,
'web'
,
// Disable introspection if you use an handler like
// FingersCrossedHandler with several log entries.
'introspection'
,
],
'handlers'
=>
[
'stream'
,
],
],
],
'processors'
=>
[
'wiki'
=>
[
'class'
=>
'
\\
MediaWiki
\\
Logger
\\
Monolog
\\
WikiProcessor'
,
],
'psr'
=>
[
'class'
=>
'
\\
Monolog
\\
Processor
\\
PsrLogMessageProcessor'
,
],
'web'
=>
[
'class'
=>
'
\\
Monolog
\\
Processor
\\
WebProcessor'
,
],
'introspection'
=>
[
'class'
=>
'
\\
Monolog
\\
Processor
\\
IntrospectionProcessor'
,
],
],
'handlers'
=>
[
'stream'
=>
[
'class'
=>
'
\\
Monolog
\\
Handler
\\
StreamHandler'
,
'args'
=>
[
self
::
getLogPath
()
],
'formatter'
=>
'line'
,
],
],
'formatters'
=>
[
'line'
=>
[
'class'
=>
'
\\
Monolog
\\
Formatter
\\
LineFormatter'
],
],
]],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jul 28, 09:46 (19 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2838558
Default Alt Text
WithLog.php (2 KB)
Attached To
Mode
rSAASMW SaaS MediaWiki
Attached
Detach File
Event Timeline
Log In to Comment