Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 777 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 777 Bytes

echo-logrusmiddleware

logrus middleware

An adapter (middleware) to make the Golang Echo web framework logging work with logrus, an excellent logging solution.

Install

$ go get github.com/sandalwing/echo-logrusmiddleware

Usage

package main

import (
	"github.com/Sirupsen/logrus"
	"github.com/labstack/echo"
	"github.com/sandalwing/echo-logrusmiddleware"
)

func main() {
	e := echo.New()

	// echo Logger interface friendly wrapper around logrus logger to use it
	// for default echo logger
	e.Logger = logrusmiddleware.Logger{logrus.StandardLogger()}
	e.Use(logrusmiddleware.Hook())

	// do the rest of your echo setup, routes, listen on server, etc..
}