summaryrefslogtreecommitdiff
path: root/main/php_syslog.c
diff options
context:
space:
mode:
authorErik Lundin <erik@coretech.se>2019-06-15 09:31:16 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-06-17 13:13:25 +0200
commit9f0515c40c85d9c22cf46f7c42338354c398e4a7 (patch)
tree8276aa2ec103caa3d55b5a8225872b83dad6b7c9 /main/php_syslog.c
parent96a6f7f7f572875e0d18de21f5f67429d1ffe099 (diff)
downloadphp-git-9f0515c40c85d9c22cf46f7c42338354c398e4a7.tar.gz
Add syslog.filter=raw
This passes through syslog message unchanged, without splitting messages at newlines.
Diffstat (limited to 'main/php_syslog.c')
-rw-r--r--main/php_syslog.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/php_syslog.c b/main/php_syslog.c
index dd16f05217..561a63cf00 100644
--- a/main/php_syslog.c
+++ b/main/php_syslog.c
@@ -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') {