mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-25 23:55:56 +03:00
[GH-ISSUE #1947] Is it possible to truncate ALL log messages so that they don't exceed a particular length? #840
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#840
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 @armclosinglock on GitHub (Feb 18, 2025).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1947
Monolog version 3
Is it possible to truncate all messages to not exceed a length of say 5000, or 10000 characters?
I see that in Monolog version 3, messages are immutable so the following does NOT work.
I tried something like
as well, but I ran into a strange error running compose install in the pipeline that seems to be related to this change that I don't quite understand.
@Seldaek commented on GitHub (Mar 15, 2025):
That should happen in the formatter IMO, or if you do it in a processor you should be able to use withMessage you just have to make sure you return the new (cloned & modified) record instance.