Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 732 Bytes

README.md

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.