You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
304 B
17 lines
304 B
11 months ago
|
package zerolog
|
||
|
|
||
|
import (
|
||
|
zl "github.com/rs/zerolog"
|
||
|
"go.wperron.io/themis/correlation"
|
||
|
)
|
||
|
|
||
|
type CorrelationHook struct{}
|
||
|
|
||
|
func (h CorrelationHook) Run(e *zl.Event, level zl.Level, msg string) {
|
||
|
ctx := e.GetCtx()
|
||
|
c := correlation.FromContext(ctx)
|
||
|
if c != nil {
|
||
|
e.Stringer("correlation_id", c)
|
||
|
}
|
||
|
}
|