logrus_fluent
logrus_fluent copied to clipboard
customization of logrus.Level stringification
Java loggers (default, logback) are using capital letters when stringifying log levels. This PR allows customizing how logrus.Level are stringified through fluentd so that when Java and Golang services logs are aggregated they are represented the same way.
Please merge it!
@evalphobia merge please)
@gcxRun @siller174 Thank you for your patience, I forgot to answer it... 🙏 💦
After v0.5.4, you can use AddCustomizer
to modify any fields.
hook.AddCustomizer(func(entry *logrus.Entry, data logrus.Fields) {
data["level"] = "Hooked " + entry.Level.String()
})
This PR changes only level
field and I thought others might want to change other fields, so AddCustomizer
was added to support such kind modification.
Sorry to forgot to answer here and thank you for your contribution ❤️