Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterLogs ¶
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(logger *log.Logger, extractFunction ExtractFunction) grpc.UnaryServerInterceptor
The first registerred interceptor will be called first. Need to register requestid first to add request-id. Then the logger can get the request-id.
Types ¶
type ExtractFunction ¶
type ExtractFunction func(ctx context.Context, req any, info *grpc.UnaryServerInfo, logger *log.Logger) *log.Logger
ExtractFunction extracts information from the ctx and/or the request and put it in the logger. This function is called before the application's handler is called so that it can add more context to the logger.
Click to show internal directories.
Click to hide internal directories.