Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 732 Bytes

File metadata and controls

36 lines (23 loc) · 732 Bytes

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.