Logrus logging for Goji
Go
Latest commit 92ccdaf Jul 24, 2014 @saj1th saj1th fixed README
Permalink
Failed to load latest commit information.
LICENSE Initial check-in Jul 23, 2014
README.md fixed README Jul 25, 2014
glogrus.go Added doc & changed the method name Jul 25, 2014
writer_proxy.go Initial check-in Jul 23, 2014

README.md

goji/glogrus GoDoc

glogrus provides structured logging via logrus for Goji.

Example

package main

import(
    "github.com/zenazn/goji"
    "github.com/zenazn/goji/web/middleware"
    "github.com/goji/glogrus"
    "github.com/Sirupsen/logrus"
)

func main() {
    goji.Abandon(middleware.Logger)

    logr := logrus.New()
    logr.Formatter = new(logrus.JSONFormatter)
    goji.Use(glogrus.NewGlogrus(logr, "my-app-name"))

    goji.Get("/ping", yourHandler)
    goji.Serve()
}

Looking for hierarchical structured logging?

slog and lunk looks interesting.