Merge pull request #6003 from cpuguy83/add_otel_log_hook

Add open telemetry logging hook for logrus
This commit is contained in:
Derek McGowan
2021-09-24 17:21:46 -07:00
committed by GitHub
4 changed files with 75 additions and 4 deletions

View File

@@ -301,6 +301,8 @@ func applyFlags(context *cli.Context, config *srvconfig.Config) error {
if err := setLogFormat(config); err != nil {
return err
}
setLogHooks()
for _, v := range []struct {
name string
d *string
@@ -366,6 +368,10 @@ func setLogFormat(config *srvconfig.Config) error {
return nil
}
func setLogHooks() {
logrus.StandardLogger().AddHook(tracing.NewLogrusHook())
}
func dumpStacks(writeToFile bool) {
var (
buf []byte