Skip to content

Commit 477c5f9

Browse files
authored
Document the changes to syslog.filter
* Documenting the changes to syslog.filter php/php-src#4265 restored the previous handling of multi-line log messages by adding `syslog.filter=raw`. * Highlight the fact that line splitting is happening in all of the three original modes, but not in "raw". * Add "raw" to syslog section of 7.3 migration guide Closes GH-589.
1 parent e86cd44 commit 477c5f9

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

appendices/migration73/other-changes.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646
<term><link linkend="ini.syslog.filter">syslog.filter</link></term>
4747
<listitem>
4848
<simpara>
49-
Specifies the filter type to filter the logged messages. There are three
49+
Specifies the filter type to filter the logged messages, with the
5050
supported filter types - <literal>all</literal>,
5151
<literal>no-ctrl</literal> and <literal>ascii</literal>.
52+
Starting with PHP 7.3.8, <literal>raw</literal> is also available,
53+
restoring the way syslog behaved in previous PHP versions.
54+
This filter will also affect calls to <function>syslog</function>.
5255
</simpara>
5356
</listitem>
5457
</varlistentry>

reference/errorfunc/ini.xml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,21 +526,36 @@
526526
<para>
527527
Specifies the filter type to filter the logged messages. Allowed
528528
characters are passed unmodified; all others are written in their
529-
hexadecimal representation prefixed with <literal>\x</literal>. There are
530-
three supported filter types:
529+
hexadecimal representation prefixed with <literal>\x</literal>.
531530
<itemizedlist>
532531
<listitem>
533-
<simpara><literal>all</literal> – all characters</simpara>
532+
<simpara><literal>all</literal> – the logged string will be split
533+
at newline characters, and all characters are passed unaltered
534+
</simpara>
534535
</listitem>
535536
<listitem>
536-
<simpara><literal>no-ctrl</literal> – all characters except control characters</simpara>
537+
<simpara><literal>ascii</literal> – the logged string will be split
538+
at newline characters, and any non-printable 7-bit ASCII characters will be escaped
539+
</simpara>
537540
</listitem>
538541
<listitem>
539-
<simpara><literal>ascii</literal> – all printable ASCII characters and <literal>NL</literal></simpara>
542+
<simpara><literal>no-ctrl</literal> – the logged string will be split
543+
at newline characters, and any non-printable characters will be escaped
544+
</simpara>
545+
</listitem>
546+
<listitem>
547+
<simpara><literal>raw</literal> – all characters are passed to the system
548+
logger unaltered, without splitting at newlines (identical to PHP before 7.3)
549+
</simpara>
540550
</listitem>
541551
</itemizedlist>
542-
Only effective if <link linkend="ini.error-log">error_log</link> is set to "syslog".
552+
This setting will affect logging via <link linkend="ini.error-log">error_log</link> set to "syslog" and calls to <function>syslog</function>.
543553
</para>
554+
<note>
555+
<para>
556+
The <literal>raw</literal> filter type is available as of PHP 7.3.8 and PHP 7.4.0.
557+
</para>
558+
</note>
544559
</listitem>
545560
</varlistentry>
546561

reference/network/functions/syslog.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ closelog();
161161
<simplelist>
162162
<member><function>openlog</function></member>
163163
<member><function>closelog</function></member>
164+
<member><link linkend="ini.syslog.filter">syslog.filter</link> INI setting (starting with PHP 7.3)</member>
164165
</simplelist>
165166
</para>
166167
</refsect1>

0 commit comments

Comments
 (0)