Middleware echo-logrus is a logrus logger support for Echo.
This middleware is working on Echo v4.
For dep users
When your project top dir run this.
$ dep ensure -add github.com/neko-neko/echo-logrus
$ go get github.com/neko-neko/echo-logrus/v2
package main
import (
"os"
"time"
"github.com/sirupsen/logrus"
"github.com/labstack/echo/v4"
echoLog "github.com/labstack/gommon/log"
"github.com/neko-neko/echo-logrus/v2"
"github.com/neko-neko/echo-logrus/v2/log"
)
func main() {
e := echo.New()
// Logger
log.Logger().SetOutput(os.Stdout)
log.Logger().SetLevel(echoLog.INFO)
log.Logger().SetFormatter(&logrus.JSONFormatter{
TimestampFormat: time.RFC3339,
})
e.Logger = log.Logger()
e.Use(middleware.Logger())
log.Info("Logger enabled!!")
e.Logger.Fatal(e.Start(":1323"))
}