From: Gergő Tisza Date: Thu, 23 Jul 2015 20:02:22 +0000 (+0000) Subject: Log exceptions in the StatsD process X-Git-Tag: 1.31.0-rc.0~10666 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24ze_article%22%29%20.%20%22?a=commitdiff_plain;h=3ebb384513c9b21501e71c77a98639f435cc7ec4;p=lhc%2Fweb%2Fwiklou.git Log exceptions in the StatsD process Change-Id: Iff14cbbfbe81d38c55b41ff115c66156323df035 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6f354c351f..167305d9ab 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1254,12 +1254,16 @@ function wfLogProfilingData() { $config = $context->getConfig(); if ( $config->get( 'StatsdServer' ) ) { - $statsdServer = explode( ':', $config->get( 'StatsdServer' ) ); - $statsdHost = $statsdServer[0]; - $statsdPort = isset( $statsdServer[1] ) ? $statsdServer[1] : 8125; - $statsdSender = new SocketSender( $statsdHost, $statsdPort ); - $statsdClient = new StatsdClient( $statsdSender ); - $statsdClient->send( $context->getStats()->getBuffer() ); + try { + $statsdServer = explode( ':', $config->get( 'StatsdServer' ) ); + $statsdHost = $statsdServer[0]; + $statsdPort = isset( $statsdServer[1] ) ? $statsdServer[1] : 8125; + $statsdSender = new SocketSender( $statsdHost, $statsdPort ); + $statsdClient = new StatsdClient( $statsdSender, true, false ); + $statsdClient->send( $context->getStats()->getBuffer() ); + } catch ( Exception $ex ) { + MWExceptionHandler::logException( $ex ); + } } # Profiling must actually be enabled...