Skip to content

An adapter to make the Golang Echo web framework logging work with github.com/sirupsen/logrus.

License

Notifications You must be signed in to change notification settings

haneefkassam/echo-logrusmiddleware

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

echo-logrusmiddleware

logrus middleware

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

Improves upon sandalwing/echo-logrusmiddleware by using the correct dependencies and including the request_id prop in the log output in order to support echo's request ID middleware.

Install

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

Usage

package main

import (
	"github.com/sirupsen/logrus"
	"github.com/labstack/echo"
	"github.com/bakatz/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{Logger: logrus.StandardLogger()}
	e.Use(logrusmiddleware.Hook())

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

About

An adapter to make the Golang Echo web framework logging work with github.com/sirupsen/logrus.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%