feat(server): Add log level to severity mapping

The output format now writes a `severity` field that follows that
format that should be recognised by Stackdriver Logging.
This commit is contained in:
Vincent Ambo 2019-10-05 22:48:19 +01:00 committed by Vincent Ambo
parent 6912658c72
commit f77c93b6ae
2 changed files with 36 additions and 3 deletions

View file

@ -247,7 +247,10 @@ func main() {
Pop: pop,
}
log.Printf("Starting Nixery (version %s) on port %s\n", version, cfg.Port)
log.WithFields(log.Fields{
"version": version,
"port": cfg.Port,
}).Info("Starting Nixery")
// All /v2/ requests belong to the registry handler.
http.Handle("/v2/", &registryHandler{