diff --git a/docker/client.go b/docker/client.go index 0c2c5951..aec4e9d0 100644 --- a/docker/client.go +++ b/docker/client.go @@ -193,7 +193,7 @@ func (d *dockerClient) ContainerStats(ctx context.Context, id string, stats chan } func (d *dockerClient) ContainerLogs(ctx context.Context, id string, tailSize int, since string) (<-chan string, <-chan error) { - log.WithField("id", id).WithField("since", since).Debug("Streaming logs for container") + log.WithField("id", id).WithField("since", since).Debug("streaming logs for container") options := types.ContainerLogsOptions{ ShowStdout: true, diff --git a/web/routes.go b/web/routes.go index 63b38837..fcc1c581 100644 --- a/web/routes.go +++ b/web/routes.go @@ -154,26 +154,26 @@ Loop: f.Flush() case e := <-err: if e == io.EOF { - log.Debugf("Container stopped: %v", container.ID) + log.Debugf("container stopped: %v", container.ID) fmt.Fprintf(w, "event: container-stopped\ndata: end of stream\n\n") f.Flush() } else { - log.Debugf("Error while reading from log stream: %v", e) + log.Debugf("error while reading from log stream: %v", e) break Loop } } } - log.WithField("NumGoroutine", runtime.NumGoroutine()).Debug("runtime goroutine stats") + log.WithField("routines", runtime.NumGoroutine()).Debug("runtime goroutine stats") if log.IsLevelEnabled(log.DebugLevel) { var m runtime.MemStats runtime.ReadMemStats(&m) // For info on each, see: https://golang.org/pkg/runtime/#MemStats log.WithFields(log.Fields{ - "Alloc": humanize.Bytes(m.Alloc), - "TotalAlloc": humanize.Bytes(m.TotalAlloc), - "Sys": humanize.Bytes(m.Sys), + "allocated": humanize.Bytes(m.Alloc), + "totalAllocated": humanize.Bytes(m.TotalAlloc), + "system": humanize.Bytes(m.Sys), }).Debug("runtime mem stats") } } @@ -216,7 +216,7 @@ func (h *handler) streamEvents(w http.ResponseWriter, r *http.Request) { case stat := <-stats: bytes, _ := json.Marshal(stat) if _, err := fmt.Fprintf(w, "event: container-stat\ndata: %s\n\n", string(bytes)); err != nil { - log.Debugf("Error writing stat to event stream: %v", err) + log.Errorf("error writing stat to event stream: %v", err) return } f.Flush() @@ -226,21 +226,21 @@ func (h *handler) streamEvents(w http.ResponseWriter, r *http.Request) { } switch event.Name { case "start", "die": - log.Debugf("Triggering docker event: %v", event.Name) + log.Debugf("triggering docker event: %v", event.Name) if event.Name == "start" { - log.Debugf("Found new container with id: %v", event.ActorID) + log.Debugf("found new container with id: %v", event.ActorID) if err := h.client.ContainerStats(ctx, event.ActorID, stats); err != nil { - log.Errorf("Error when streaming new container stats: %v", err) + log.Errorf("error when streaming new container stats: %v", err) } if err := sendContainersJSON(h.client, w); err != nil { - log.Errorf("Error encoding containers to stream: %v", err) + log.Errorf("error encoding containers to stream: %v", err) return } } bytes, _ := json.Marshal(event) if _, err := fmt.Fprintf(w, "event: container-%s\ndata: %s\n\n", event.Name, string(bytes)); err != nil { - log.Debugf("Error writing event to event stream: %v", err) + log.Errorf("error writing event to event stream: %v", err) return }