diff --git a/adapter/kratos/log.go b/adapter/kratos/log.go index 0f52f3a..b0fa7b1 100644 --- a/adapter/kratos/log.go +++ b/adapter/kratos/log.go @@ -21,6 +21,7 @@ type LoggerKratosAdapter struct { // // import ( // "github.com/coopnorge/go-logger" +// "github.com/coopnorge/go-logger/adapter/kratos" // "github.com/go-kratos/kratos/v2/log" // ) // diff --git a/docs/index.md b/docs/index.md index 40edba7..e267254 100644 --- a/docs/index.md +++ b/docs/index.md @@ -141,6 +141,25 @@ func main() { } ``` +### Kratos + +To ensure that Kratos outputs logs in the correct format Kratos must be +configured with a custom logger. + +```go + package main + + import ( + "github.com/coopnorge/go-logger" + "github.com/coopnorge/go-logger/adapter/kratos" + "github.com/go-kratos/kratos/v2/log" + ) + + func main() { + log.SetLogger(logs.NewLoggerKratosAdapter(logger.Global())) + } +``` + ## Hooks Hooks are functions that are triggered on all log-entries and allow for data to