Documentation ¶
Index ¶
- func GetLogEntry(r *http.Request) logrus.FieldLogger
- func LogEntrySetField(r *http.Request, key string, value interface{})
- func LogEntrySetFields(r *http.Request, fields map[string]interface{})
- func New(ctx context.Context) *log.Entry
- func NewStructuredLogger(logger *logrus.Logger) func(next http.Handler) http.Handler
- type StructuredLogger
- type StructuredLoggerEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogEntry ¶
func GetLogEntry(r *http.Request) logrus.FieldLogger
GetLogEntry helper function for getting log entry for request
func LogEntrySetField ¶
LogEntrySetField sets a key's value
func LogEntrySetFields ¶
LogEntrySetFields sets the log entry's fields
Types ¶
type StructuredLogger ¶
StructuredLogger is a logger for chi router
func (*StructuredLogger) NewLogEntry ¶
func (l *StructuredLogger) NewLogEntry(r *http.Request) middleware.LogEntry
NewLogEntry creates a new log entry for the given HTTP request
type StructuredLoggerEntry ¶
type StructuredLoggerEntry struct {
Logger logrus.FieldLogger
}
StructuredLoggerEntry is a log entry will all relevant information about a specific http request
func (*StructuredLoggerEntry) Panic ¶
func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte)
Panic logs if the request panics
Click to show internal directories.
Click to hide internal directories.