# [PATCH] Raw logging to syslog

- Thread: https://externals.io/message/105934
- Original archive: https://news-web.php.net/php.internals/105934
- Started by Erik Lundin on 2019-06-15T07:49:34+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #105934 — Erik Lundin — 2019-06-15T07:49:34+00:00

URL: https://externals.io/message/105934#105934

Background:
In newer versions of PHP the syslog logging is forced to multiline logging 
and it's not possible to turn this off. This is especially problematic 
when you have a lot of logging and need to search and find connected lines 
from a single call to `syslog()`. For example when debugging multiline 
sql-queries.

Test code:
syslog(LOG_INFO, "test1\t\ttest2\ntest3");

Old behaviour (PHP 5.4.16 (cli) - CentOS 7):
Jun 15 08:55:45 server php: test1#011#011test2#012test3

New behaviour (PHP 7.4 (dev)- CentOS 7):
Jun 15 08:55:45 server php: test1\x09\x09test2
Jun 15 08:55:45 server php: test3

After patch and with configuration value (syslog.filter=raw):
Jun 15 08:55:45 server php: test1#011#011test2#012test3

Suggested change:
This patch includes a new configuration value for syslog.filter (raw) 
which allows to send the logging data in it's raw form to the syslog. The 
code for the other configuration values should be untouched by this 
change.

Link to pull request:
https://github.com/php/php-src/pull/4265

--
Regards, Erik Lundin
