Documentation ¶
Overview ¶
provides structured logging with logrus.
Index ¶
- Variables
- func CloseDB(pool *dockertest.Pool, resource *dockertest.Resource)
- func GetLogEntry(r *http.Request) logrus.FieldLogger
- func InitDB() (*dockertest.Pool, *dockertest.Resource)
- func LogEntrySetField(r *http.Request, key string, value interface{})
- func LogEntrySetFields(r *http.Request, fields map[string]interface{})
- func NewLogger() *logrus.Logger
- func NewStructuredLogger(logger *logrus.Logger) func(next http.Handler) http.Handler
- type StructuredLogger
- type StructuredLoggerEntry
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Logger is a configured logrus.Logger. Logger *logrus.Logger )
Functions ¶
func GetLogEntry ¶
func GetLogEntry(r *http.Request) logrus.FieldLogger
GetLogEntry return the request scoped logrus.FieldLogger.
func LogEntrySetField ¶
LogEntrySetField adds a field to the request scoped logrus.FieldLogger.
func LogEntrySetFields ¶
LogEntrySetFields adds multiple fields to the request scoped logrus.FieldLogger.
Types ¶
type StructuredLogger ¶
StructuredLogger is a structured logrus Logger.
func (*StructuredLogger) NewLogEntry ¶
func (l *StructuredLogger) NewLogEntry(r *http.Request) middleware.LogEntry
NewLogEntry sets default request log fields.
type StructuredLoggerEntry ¶
type StructuredLoggerEntry struct {
Logger logrus.FieldLogger
}
StructuredLoggerEntry is a logrus.FieldLogger.
func (*StructuredLoggerEntry) Panic ¶
func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte)
Panic prints stack trace
Click to show internal directories.
Click to hide internal directories.