Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / debug / logger / monolog / WikiProcessor.php
index e39a2c3..dc3c1f2 100644 (file)
@@ -20,6 +20,8 @@
 
 namespace MediaWiki\Logger\Monolog;
 
+use WikiMap;
+
 /**
  * Annotate log records with request-global metadata, such as the hostname,
  * wiki / request ID, and MediaWiki version.
@@ -36,10 +38,10 @@ class WikiProcessor {
        public function __invoke( array $record ) {
                global $wgVersion;
                $record['extra']['host'] = wfHostname();
-               $record['extra']['wiki'] = wfWikiID();
+               $record['extra']['wiki'] = WikiMap::getWikiIdFromDbDomain( WikiMap::getCurrentWikiDbDomain() );
                $record['extra']['mwversion'] = $wgVersion;
                $record['extra']['reqId'] = \WebRequest::getRequestId();
-               if ( PHP_SAPI === 'cli' && isset( $_SERVER['argv'] ) ) {
+               if ( wfIsCLI() && isset( $_SERVER['argv'] ) ) {
                        $record['extra']['cli_argv'] = implode( ' ', $_SERVER['argv'] );
                }
                return $record;