mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #1625] How do I output level as the level name instead of the constant value? #690
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#690
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 @LeoAdamek on GitHub (Jan 11, 2022).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1625
How do I have my output (when using the
JSONFormatter) output the level name (e.g. info) in thelevelfield, rather than the level constant value (e.g. 200)? My log management tools don't understand the numeric levels so don't display the logs properly.I tried using a processor to copy the
level_namevalue tolevelbut this caused other handlers/formatters etc which used the level value to error.@Seldaek commented on GitHub (Mar 7, 2022):
I would say write your own formatter that does what you need.