Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log level not compliant with rfc5424 #1892

Open
anthosz opened this issue May 31, 2024 · 2 comments
Open

Log level not compliant with rfc5424 #1892

anthosz opened this issue May 31, 2024 · 2 comments
Labels
Milestone

Comments

@anthosz
Copy link

anthosz commented May 31, 2024

Hello,

Following https://github.com/Seldaek/monolog/blob/main/doc/01-usage.md#log-levels:
image

There is strange level for each severity especially if it's supposed to be compliant with rfc5424.

In fact, it's not really the case. According to https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1 (table 2): "Severity values MUST be in the range of 0 to 7 inclusive."

Could you please change it?

It can lead to some issues during parsing from some log parsers ootb.

Thank you!

@anthosz anthosz added the Bug label May 31, 2024
@Seldaek
Copy link
Owner

Seldaek commented Jun 28, 2024

You can make sure your formatters use $record->level->toRFC5424Level() to format stuff to get compliant levels if you care about the actual level used. The syslog formatter for example uses that.

The internal levels are the way they are for BC reasons and I don't think they should be changed. Maybe something for v4 though if we could add a way to opt-in to it in v3 ideally.. I'll leave this open for now as reminder.

@Seldaek Seldaek added this to the 3.x milestone Jun 28, 2024
@anthosz
Copy link
Author

anthosz commented Jun 28, 2024

Thank you for your feedback and let's see :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants