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

possibility to adjust the levelstrings #25

Open
giddel opened this issue Sep 21, 2020 · 4 comments
Open

possibility to adjust the levelstrings #25

giddel opened this issue Sep 21, 2020 · 4 comments

Comments

@giddel
Copy link

giddel commented Sep 21, 2020

I'm using log4go in GCP environment with Stackdriver logging. Formatting a log message with pattern like:

"pattern": "{\"severity\": \"%L\", \"message\":\"(%S) %M\"}"

gives Stackdriver the possibility to recognize the loglevel and can so visualize the message in a proper way in the UI and gives the posibility to filter the messages by It's severity.

log4go-stackdriver-loglevels

Unfortunately the Log4go levelstrings defined in

levelStrings = [...]string{"FNST", "FINE", "DEBG", "TRAC", "INFO", "WARN", "EROR", "CRIT"}
do not match completely with the levels from Stackdriver
(https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity) so only a few severities are matched and the others are treated as "UNKOWN"

Log4go Stackdriver Match
FNST - -
FINE - -
DEBG DEBUG NO
TRAC TRACE NO
INFO INFO YES
WARN WARN YES
EROR ERROR NO
CRIT CRITICAL YES

I'm looking for a possibility to overwrite the fixed levelstrings in log4go with my own levelstrings.

@giddel giddel changed the title posibility to adjust the levelstrings possibility to adjust the levelstrings Sep 21, 2020
@giddel
Copy link
Author

giddel commented Apr 21, 2022

Is there anybody out there?

@giddel
Copy link
Author

giddel commented Oct 5, 2022

Anybody alive?

@FateTHarlaown
Copy link

It seems no one alive

@giddel
Copy link
Author

giddel commented Jul 19, 2023

I'm using zap in the meanwhile ... :-(

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

No branches or pull requests

2 participants