diff options
| author | jvoisin | 2020-07-04 17:37:35 +0200 |
|---|---|---|
| committer | jvoisin | 2020-07-04 17:37:35 +0200 |
| commit | 6c7ad0c1dfcf324828be4153b86a808b35995820 (patch) | |
| tree | 4ee26c2deef0390ce8eb71a3f35187248526ca0b /src/sp_utils.c | |
| parent | ed12d6c784e524bdf50f6f503160cd55216d34d7 (diff) | |
Fix a syslog-related issue
Previously, the syslog logging would always
go to LOG_ERR no matter the severity.
Diffstat (limited to 'src/sp_utils.c')
| -rw-r--r-- | src/sp_utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c index 0f87f17..40cf44e 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c | |||
| @@ -23,7 +23,7 @@ void sp_log_msg(char const* feature, int type, const char* fmt, ...) { | |||
| 23 | case SP_SYSLOG: | 23 | case SP_SYSLOG: |
| 24 | openlog(PHP_SNUFFLEUPAGUS_EXTNAME, LOG_PID, LOG_AUTH); | 24 | openlog(PHP_SNUFFLEUPAGUS_EXTNAME, LOG_PID, LOG_AUTH); |
| 25 | const char* error_filename = zend_get_executed_filename(); | 25 | const char* error_filename = zend_get_executed_filename(); |
| 26 | int syslog_level = SP_LOG_DROP ? LOG_ERR : LOG_INFO; | 26 | int syslog_level = (type == SP_LOG_DROP) ? LOG_ERR : LOG_INFO; |
| 27 | int error_lineno = zend_get_executed_lineno(TSRMLS_C); | 27 | int error_lineno = zend_get_executed_lineno(TSRMLS_C); |
| 28 | syslog(syslog_level, "[snuffleupagus][%s][%s] %s in %s on line %d", client_ip, feature, msg, | 28 | syslog(syslog_level, "[snuffleupagus][%s][%s] %s in %s on line %d", client_ip, feature, msg, |
| 29 | error_filename, error_lineno); | 29 | error_filename, error_lineno); |
