mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #841] preg_split null value in SyslogUdpHandler.php #326
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#326
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pjuanda on GitHub (Aug 30, 2016).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/841
Hi,
I have an issue when handling log with SyslogUdpHandler.php. In its method splitIntoLines, it will split
$messageinto 2 lines although$messageisNULL.I have checked it out, this problem is caused by preg_split
To solve the problem, we can pass
PREG_SPLIT_NO_EMPTYflag as its 4th parameterIs this a bug ? or the
$record['formatted']value must notNULLin the first place ?Note : I'm using custom Formatter that override some methods from
NormalizeFormatter. Here is my custom formatter@Seldaek commented on GitHub (Sep 25, 2016):
Normally the formatted key should be non-null yeah, it's a bit strange that you use the formatter as a way to filter messages basically.. This is usually done with the FingersCrossedHandler + a custom activation strategy, but then again if it is null it shouldn't break so I'll apply your patch thanks.