negronilogrus

package module
v0.0.0-...-3c0a942 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2015 License: MIT Imports: 5 Imported by: 0

README

negroni-logrus

GoDoc

logrus middleware for negroni

Usage

Take a peek at the basic example or the custom example, the latter of which includes setting a custom log level on the logger with NewCustomMiddleware!.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	// Logger is the log.Logger instance used to log messages with the Logger middleware
	Logger *logrus.Logger
	// Name is the name of the application as recorded in latency metrics
	Name string
}

Middleware is a middleware handler that logs the request as it goes in and the response as it goes out.

func NewCustomMiddleware

func NewCustomMiddleware(level logrus.Level, formatter logrus.Formatter, name string) *Middleware

NewCustomMiddleware builds a *Middleware with the given level and formatter

func NewMiddleware

func NewMiddleware() *Middleware

NewMiddleware returns a new *Middleware, yay!

func NewMiddlewareWithExistingLogrus

func NewMiddlewareWithExistingLogrus(logger *logrus.Logger, name string) *Middleware

NewMiddlewareWithExistingLogrus returns a new *Middleware which writes to a given logrus logger.

func (*Middleware) ServeHTTP

func (l *Middleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL