Documentation
¶
Index ¶
- func GetLogEntry(r *http.Request) logr.Logger
- func GetReqID(ctx context.Context) string
- func LogEntrySetField(r *http.Request, key string, value interface{})
- func LogEntrySetFields(r *http.Request, keysAndValues ...interface{})
- func NewLogr(log logr.Logger, geodb *geoip2.Reader) func(next http.Handler) http.Handler
- func RequestID(next http.Handler) http.Handler
- type Logger
- type LogrEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetReqID ¶
GetReqID returns a request ID from the given context if one is present. Returns the empty string if a request ID cannot be found.
func LogEntrySetField ¶
func LogEntrySetFields ¶
func RequestID ¶
RequestID is a middleware that injects a request ID into the context of each request. A request ID is a string of the form "host.example.com/random-0001", where "random" is a base62 random string that uniquely identifies this go process, and where the last number is an atomically incremented request counter.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) NewLogEntry ¶
func (l *Logger) NewLogEntry(r *http.Request) middleware.LogEntry
Click to show internal directories.
Click to hide internal directories.