We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe.
不是
Describe the solution you'd like
目前logger接口不能自定义kv,这个在日志查询中会非常不方便,并且像es也需要带@timestamp的字段,而logger默认时间戳是ts字段,没法自定义名称或者新增个@timestamp字段,希望可以参考kratos框架的Logger实现自定义kv字段: https://go-kratos.dev/docs/component/log/
最终Logger可以优化成类似这种形式: type Logger interface { Trace(msg string, keyvals ...interface{}) Debug(msg string, keyvals ...interface{}) Info(msg string, keyvals ...interface{}) Notice(msg string, keyvals ...interface{}) Warn(msg string, keyvals ...interface{}) Error(msg string, keyvals ...interface{}) Fatal(msg string, keyvals ...interface{}) }
最好不需要更改存量业务代码
Describe alternatives you've considered
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Please assign this issue to me
Sorry, something went wrong.
hertz-contrib/logger#33 @li-jin-gou
smx-Morgan
No branches or pull requests
Is your feature request related to a problem? Please describe.
不是
Describe the solution you'd like
目前logger接口不能自定义kv,这个在日志查询中会非常不方便,并且像es也需要带@timestamp的字段,而logger默认时间戳是ts字段,没法自定义名称或者新增个@timestamp字段,希望可以参考kratos框架的Logger实现自定义kv字段:
https://go-kratos.dev/docs/component/log/
最终Logger可以优化成类似这种形式:
type Logger interface {
Trace(msg string, keyvals ...interface{})
Debug(msg string, keyvals ...interface{})
Info(msg string, keyvals ...interface{})
Notice(msg string, keyvals ...interface{})
Warn(msg string, keyvals ...interface{})
Error(msg string, keyvals ...interface{})
Fatal(msg string, keyvals ...interface{})
}
最好不需要更改存量业务代码
Describe alternatives you've considered
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: