]> git.openstreetmap.org Git - nominatim.git/commitdiff
strip query log to minimum info not available in apache logs
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 12 Dec 2014 22:13:44 +0000 (23:13 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 12 Dec 2014 22:13:44 +0000 (23:13 +0100)
lib/log.php

index d38bb892b78a0d876e5c93a79e5b85032413b500..80e2ac54db8490284d0d4400bed9332c5ac3c5cc 100644 (file)
@@ -5,15 +5,6 @@
                $aStartTime = explode('.',microtime(true));
                if (!isset($aStartTime[1])) $aStartTime[1] = '0';
 
-               if (isset($_GET['email']))
-                               $sUserAgent = $_GET['email'];
-                       elseif (isset($_SERVER['HTTP_REFERER']))
-                               $sUserAgent = $_SERVER['HTTP_REFERER'];
-                       elseif (isset($_SERVER['HTTP_USER_AGENT']))
-                               $sUserAgent = $_SERVER['HTTP_USER_AGENT'];
-                       else
-                               $sUserAgent = '';
-
                $sOutputFormat = '';
                if (isset($_GET['format'])) $sOutputFormat = $_GET['format'];
 
@@ -32,7 +23,6 @@
                                $_SERVER['QUERY_STRING'],
                                $sOutQuery,
                                $sType,
-                               $sUserAgent,
                                $sOutputFormat
                                );
 
 
                if (CONST_Log_File)
                {
-                       array_unshift($hLog, $sEndTime);
-                       $hLog[] = $iNumResults;
+                       $aOutdata = array($hLog[0], $sEndTime, $iNumResults, $hLog[4], $hLog[2]);
                        $fLog = fopen(CONST_Log_File, 'a');
                        flock($fLog, LOCK_EX);
-                       fputcsv($fLog, $hLog);
+                       fputcsv($fLog, $aOutdata);
                        fflush($fLog);
                        flock($fLog, LOCK_UN);
                        fclose($fLog);