You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possibly out of scope, but this might be a chance to move to log in ECS format as well. I dug around the code a bit, and it seems like ECK uses controller-runtime's logger which is based on uber's Zap. If this is right, I have an ECS-friendly log configuration for it that I use in other projects:
config := zap.NewProductionConfig()
// Get as close as we can to ECS format
config.EncoderConfig.LevelKey = "log.level"
config.EncoderConfig.NameKey = "event.category"
config.EncoderConfig.TimeKey = "@timestamp"
config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
logger, err = config.Build()
The logger variable above is a zap.Logger and should be something you can pass here: to logf.SetLogger(...)
In GCP, StackDriver logging will render structured log messages in a human-friendly way if the log message is associated with a key named message. I propose to do that as a part of this change as well unless there are any objections.
I'd love if these timestamps were human readable. We can achieve that while still making them machine readable by logging in ISO8601/RFC3339 format.
^^ The above logs are from ECK 0.8.1
The text was updated successfully, but these errors were encountered: