Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGlogrus ¶
NewGlogrus allows you to configure a goji middleware that logs all requests and responses using the structured logger logrus. It takes the logrus instance and the name of the app as the parameters and returns a middleware of type "func(c *web.C, http.Handler) http.Handler"
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() }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.