From b6e7b2d9fde9784c52b02cfa19960756a4afa314 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 2 Feb 2012 16:35:02 +0000 Subject: [PATCH] * Always add the hostname in wfDebugLog(), whatever $wgShowHostnames is, since that setting is for user display, not internal stuff * Use wfHostname() and wfWikiId() instead of executing "hostname" command and $wgDBname respectively for consistency --- includes/GlobalFunctions.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index b1bd3f2758..78af432edd 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -947,16 +947,12 @@ function wfDebugMem( $exact = false ) { * log file is specified, (default true) */ function wfDebugLog( $logGroup, $text, $public = true ) { - global $wgDebugLogGroups, $wgShowHostnames; + global $wgDebugLogGroups; $text = trim( $text ) . "\n"; if( isset( $wgDebugLogGroups[$logGroup] ) ) { $time = wfTimestamp( TS_DB ); $wiki = wfWikiID(); - if ( $wgShowHostnames ) { - $host = wfHostname(); - } else { - $host = ''; - } + $host = wfHostname(); if ( wfRunHooks( 'Debug', array( $text, $logGroup ) ) ) { wfErrorLog( "$time $host $wiki: $text", $wgDebugLogGroups[$logGroup] ); } @@ -973,8 +969,9 @@ function wfDebugLog( $logGroup, $text, $public = true ) { function wfLogDBError( $text ) { global $wgDBerrorLog, $wgDBname; if ( $wgDBerrorLog ) { - $host = trim(`hostname`); - $text = date( 'D M j G:i:s T Y' ) . "\t$host\t$wgDBname\t$text"; + $host = wfHostname(); + $wiki = wfWikiID(); + $text = date( 'D M j G:i:s T Y' ) . "\t$host\t$wiki\t$text"; wfErrorLog( $text, $wgDBerrorLog ); } } -- 2.20.1