Versions in this module Expand all Collapse all v1 v1.0.0 Mar 2, 2022 Changes in this version + var FieldDuration = "duration" + var FieldErrorCause = "errorCause" + var FieldErrorStack = "errorStack" + var FieldHTTPMethod = "httpMethod" + var FieldHTTPRemoteAddr = "httpRemoteAddr" + var FieldHTTPRespLen = "httpRespLen" + var FieldHTTPRespStatus = "httpRespStatus" + var FieldHTTPSourceIP = "httpSourceIp" + var FieldHTTPURI = "httpUri" + var FieldHTTPUserAgent = "httpUserAgent" + var FieldProtocol = "protocol" + var FieldRequestID = "requestId" + func ContextLogger(ctx context.Context) *logrus.Entry + func GetCause(err error) (error, bool) + func NewEventContext(ctx context.Context, event *Event) context.Context + func RequestIP(r *http.Request, trustForwardedFor bool) string + func RequestLogger(r *http.Request) *logrus.Entry + func SetRequestError(r *http.Request, err error) + func SetRequestField(r *http.Request, key string, value interface{}) + func UnwrapAll(err error) error + type Event struct + func EventFromContext(ctx context.Context) *Event + func NewEvent(logger *logrus.Entry) *Event + func (e *Event) GetField(key string) interface{} + func (e *Event) Logger() *logrus.Entry + func (e *Event) SetError(err error) + func (e *Event) SetField(key string, value interface{}) + type HTTPMiddleware struct + BuildEvent func(r *http.Request, e *Event) + EventLogMessage string + LogEvent func(e *Event) + LogRequest func(e *Event) + RequestIDHeaderKey string + RequestLogMessage string + TrustForwardedFor bool + func NewHTTPMiddleware(next http.Handler, logger *logrus.Entry) *HTTPMiddleware + func (m *HTTPMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) Other modules containing this package github.com/bancek/events/v2