catalyst-zero/middleware-server — pull request #11 by ZeissS (2014-04-09 16:09:13+00:00)
Title: Log all the things

First steps for #10. This PR adds accesslogging for every request. For this I have written a reusable (and middleware-server indepent) http.Handler in `accesslog.go`.

Output from `stm-api-service` now looks like this:

```
2014/04/09 18:03:30 logaccess.go:58: [INFO] GET /v1/challenge/ 200 347 1
2014/04/09 18:03:32 logaccess.go:58: [INFO] GET /v1/challenge/ 200 347 1
2014/04/09 18:03:33 logaccess.go:58: [INFO] GET /v1/challenge/ 200 347 1
2014/04/09 18:03:34 logaccess.go:58: [INFO] GET /v1/challenge/ 200 347 1
2014/04/09 18:03:40 server.go:160: [ERROR] GET /v1/challenge/ Get http://127.0.0.1:8084/v1/counter/shared-meals/challenge/62e082f5-e070-4c00-b7f6-77dff4732202/date/2014-04-09: dial tcp 127.0.0.1:8084: connection refused
2014/04/09 18:03:40 logaccess.go:58: [INFO] GET /v1/challenge/ 500 157 0
```

The `Server` object now has two loggers: `AccessLogger` (for the requests) and `StatusLogger` (for errors and startup infos).