mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Add syslog.filter=raw
This passes through syslog message unchanged, without splitting messages at newlines.
This commit is contained in:
committed by
Nikita Popov
parent
96a6f7f7f5
commit
9f0515c40c
3
NEWS
3
NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.3.8
|
||||
|
||||
- Core:
|
||||
. Added syslog.filter=raw option. (Erik Lundin)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #78106 (Path resolution fails if opcache disabled during request).
|
||||
(Nikita)
|
||||
|
||||
@@ -346,6 +346,10 @@ static PHP_INI_MH(OnSetLogFilter)
|
||||
PG(syslog_filter) = PHP_SYSLOG_FILTER_ASCII;
|
||||
return SUCCESS;
|
||||
}
|
||||
if (!strcmp(filter, "raw")) {
|
||||
PG(syslog_filter) = PHP_SYSLOG_FILTER_RAW;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -77,6 +77,13 @@ PHPAPI void php_syslog(int priority, const char *format, ...) /* {{{ */
|
||||
smart_string_0(&fbuf);
|
||||
va_end(args);
|
||||
|
||||
if (PG(syslog_filter) == PHP_SYSLOG_FILTER_RAW) {
|
||||
/* Just send it directly to the syslog */
|
||||
syslog(priority, "%.*s", (int)fbuf.len, fbuf.c);
|
||||
smart_string_free(&fbuf);
|
||||
return;
|
||||
}
|
||||
|
||||
for (ptr = fbuf.c; ; ++ptr) {
|
||||
c = *ptr;
|
||||
if (c == '\0') {
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#define PHP_SYSLOG_FILTER_ALL 0
|
||||
#define PHP_SYSLOG_FILTER_NO_CTRL 1
|
||||
#define PHP_SYSLOG_FILTER_ASCII 2
|
||||
#define PHP_SYSLOG_FILTER_RAW 3
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
PHPAPI void php_syslog(int, const char *format, ...);
|
||||
|
||||
@@ -596,6 +596,7 @@ html_errors = On
|
||||
; ascii (all printable ASCII characters and NL)
|
||||
; no-ctrl (all characters except control characters)
|
||||
; all (all characters)
|
||||
; raw (like "all", but messages are not split at newlines)
|
||||
; http://php.net/syslog.filter
|
||||
;syslog.filter = ascii
|
||||
|
||||
|
||||
@@ -603,6 +603,7 @@ html_errors = On
|
||||
; ascii (all printable ASCII characters and NL)
|
||||
; no-ctrl (all characters except control characters)
|
||||
; all (all characters)
|
||||
; raw (like "all", but messages are not split at newlines)
|
||||
; http://php.net/syslog.filter
|
||||
;syslog.filter = ascii
|
||||
|
||||
|
||||
Reference in New Issue
Block a user