From 6fe468f7db3b872527ee3d13d96f5189ecce0dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 17 Feb 2016 10:28:04 +0100 Subject: [PATCH] Improve syslog integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - correctly open log - log only failures Issue #6146 Signed-off-by: Michal Čihař --- libraries/logging.lib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/logging.lib.php b/libraries/logging.lib.php index 105a9ead7d..c82c478017 100644 --- a/libraries/logging.lib.php +++ b/libraries/logging.lib.php @@ -22,10 +22,12 @@ function PMA_logUser($user, $status = 'ok') apache_note('userID', $user); apache_note('userStatus', $status); } - if (function_exists('syslog')) { + if (function_exists('syslog') && $status != 'ok') { + @openlog('phpMyAdmin', LOG_NDELAY | LOG_PID, LOG_AUTHPRIV); @syslog( - LOG_AUTHPRIV, - 'phpMyAdmin: ' . $user . ' (' . $status . ') from ' . $_SERVER['REMOTE_ADDR'] + LOG_WARNING, + 'user denied: ' . $user . ' (' . $status . ') from ' . + $_SERVER['REMOTE_ADDR'] ); } }