From c1d7f2ccc7a3c563ae666d42e885a150ababde56 Mon Sep 17 00:00:00 2001 From: Bryan Davis Date: Thu, 21 Jan 2016 09:11:06 -0700 Subject: [PATCH] Update ApiAction logging channel values Update the data values and naming conventions for structured API logging on the ApiAction channel to match recommended conventions for log events being recorded to Wikimedia Foundation analytics storage. Bug: T108618 Change-Id: I94c730f196bb8629cac9408e61139fab79a34f8d --- includes/api/ApiMain.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index ed5c1bc22a..e9d6316510 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -1341,19 +1341,19 @@ class ApiMain extends ApiBase { protected function logRequest( $time ) { $request = $this->getRequest(); $logCtx = [ - 'dt' => date( 'c' ), - 'client_ip' => $request->getIP(), - 'user_agent' => $this->getUserAgent(), + 'ts' => time(), + 'ip' => $request->getIP(), + 'userAgent' => $this->getUserAgent(), 'wiki' => wfWikiID(), - 'time_backend_ms' => round( $time * 1000 ), + 'timeSpentBackend' => round( $time * 1000 ), 'params' => [], ]; // Construct space separated message for 'api' log channel $msg = "API {$request->getMethod()} " . wfUrlencode( str_replace( ' ', '_', $this->getUser()->getName() ) ) . - " {$logCtx['client_ip']} " . - "T={$logCtx['time_backend_ms']}ms"; + " {$logCtx['ip']} " . + "T={$logCtx['timeSpentBackend']}ms"; foreach ( $this->getParamsUsed() as $name ) { $value = $request->getVal( $name ); -- 2.20.1