-
Notifications
You must be signed in to change notification settings - Fork 222
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
[FLI-148] posibility to configure Zap logger keys #1252
Comments
This actually went by as a suggestion when we moved from logrus to zap in #1020. I like the idea, I think it needs some thought r.e. backwards compatibility with existing config. Though, it should be achievable. Here is where the default config for zap is currently defined: Lines 57 to 78 in b3fc4b1
Then the following Flipt configuration values adjust that configuration slightly: Lines 14 to 19 in b3fc4b1
Once configuration is initialized, that config is adjusted down here: Lines 159 to 186 in b3fc4b1
Here are some thoughts on how it could be adjusted:
We already use the same keys Line 171 in b3fc4b1
The
For example, log:
zap:
level: debug
development: false
# ... Off the top of my head, I can't quite think of a nice name for this key. This could be a mutually exclusive space. Whereby you can either set the original
Mark recently introduced a version to the entire config file. |
One additional thought is we would need to consider how well it plays with I suspect we might be able to knit it altogether nicely: It might just require us to support something like that Or to make an equivalent structure with appropriate annotations and copy the config across. Update: I see that the zapcore config does do a lot of unmarshal text and yaml custom overrides: This could likely need some attention to support it with However, I don't think it supports unmarshal yaml. This is where we might need to do a little surgery. |
In my case, I use a separate config file for Zap configuration
|
Thats a nice alternative idea. Could have a line in the Flipt config which points to the files location. |
@giddel FYI we're looking to support this in the |
Apologies, this got bumped into I am circling back to this now. After discussing with @markphelps we decided we liked to keep the solution abstracted away from Zap. We love Zap, we intend to keep it. However, we're also going to "never say never" on replacing it. So we would like to abstract the details from our own configuration as much as possible. Ill attempt to share a proposal shortly of what the config could look like and see what we think. |
I've tried it out locally and it looks good for me so far. |
@giddel we'll create a new release this week with these changes in it! |
Great! I will check it as soon as possible. |
@giddel this has been released in https://github.com/flipt-io/flipt/releases/tag/v1.18.1. Please give it go and let us know what you think! We'll be updating docs today as well |
Problem
Great thing to use Zap as logger. Unfortunately the logger keys are hardcoded in
main.go
. At least GCP looging cannot understand the logger keys. Alle entries at now are logged atINFO
severity.Ideal Solution
So it would be great to set the complete Zap logger config like this:
Which then looks like this:
FLI-148
The text was updated successfully, but these errors were encountered: