Skip to content

Interceptors not compatible with log/slog.Default() #738

@simone-dimaulo-hs

Description

@simone-dimaulo-hs

The current implementation is not compatible with the std library log/slog package
https://github.com/grpc-ecosystem/go-grpc-middleware/blob/main/interceptors/logging/logging.go#L188-L196

The compiler error is

have Log(context.Context, slog.Level, string, ...any)
want Log(context.Context, logging.Level, string, ...any)

Go version used: any version from 1.21

What happened:
It's not possible to inject the slog.Default() logger to the interceptor

What you expected to happen:
I'd like to be able to use the std slog logger

Any plan to be compatible with slog/log ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions