Browse Source

Add a note about outgrowing Logger

This is a common enough question that it's worth calling out explicitly.
Carl Jackson 11 years ago
parent
commit
ac6efd8f69
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      web/middleware/logger.go

+ 7
- 0
web/middleware/logger.go View File

@ -16,6 +16,13 @@ import (
// print in color, otherwise it will print in black and white. // print in color, otherwise it will print in black and white.
// //
// Logger prints a request ID if one is provided. // Logger prints a request ID if one is provided.
//
// Logger has been designed explicitly to be Good Enough for use in small
// applications and for people just getting started with Goji. It is expected
// that applications will eventually outgrow this middleware and replace it with
// a custom request logger, such as one that produces machine-parseable output,
// outputs logs to a different service (e.g., syslog), or formats lines like
// those printed elsewhere in the application.
func Logger(c *web.C, h http.Handler) http.Handler { func Logger(c *web.C, h http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) { fn := func(w http.ResponseWriter, r *http.Request) {
reqID := GetReqID(*c) reqID := GetReqID(*c)


Loading…
Cancel
Save