mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #1890] Truncated JsonFormatter logs at 8191 characters #809
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#809
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 @Mad4T on GitHub (May 21, 2024).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1890
version
Monolog version: 3.0
Laravel: 10.0
Issue Description:
We're encountering log truncation at 8191 characters within our Laravel application deployed on AWS ECS. CloudWatch logs from this specific app are affected, while logs from other apps function normally.
We suspect a potential limitation within Monolog (version 3.0) might be causing this behavior.
Expected Behavior:
We expect CloudWatch logs from our Laravel app to be captured in their entirety without truncation.
Code Snippet (relevant part of logger.php):
'stderr' => [ 'driver' => 'monolog', 'handler' => StreamHandler::class, 'formatter' => env('LOG_STDERR_FORMATTER'), 'with' => [ 'stream' => 'php://stderr', ], ]@Seldaek commented on GitHub (Jun 28, 2024):
AFAIK there is no such limit in Monolog itself, but I am not very familiar with ECS and there might be something else there.
@Mad4T commented on GitHub (Jun 30, 2024):
Issue happens in ECS and EKS. Also worth noting that logs from none php apps are not truncated.
@Seldaek commented on GitHub (Jul 6, 2024):
Yeah sorry but that's something you'll have to debug yourself I am afraid.. There is too much environment specific stuff at play here for me to help much.
@Seldaek commented on GitHub (Jul 11, 2024):
If you figure it out please share here, it may help someone else one day
@Mad4T commented on GitHub (Jul 14, 2024):
if we ever find the reason will post it here, but we ended up doing a workaround to truncate the logs using Processor :
@sc0rp10 commented on GitHub (Apr 2, 2025):
@Mad4T please take a look to log_limit setting of php-fpm: it was the key to solving a similar problem in my case (I'm writing this mostly for folks from google).
@Seldaek It would be great if you added this information to the readme, very difficult to find the cause of this truncation.
@Seldaek commented on GitHub (Apr 2, 2025):
Feel free to send a PR if you have a good understanding of the problem because I have zero context here so it'll take me much more effort and probably not get done..