Skip to content

Commit

Permalink
map level to severity for stackdriver
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril TOVENA authored and markmandel committed Sep 21, 2018
1 parent 673b917 commit e9d267d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/util/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ type stackTracer interface {

// replace the standard glog error logger, with a logrus one
func init() {
logrus.SetFormatter(&logrus.JSONFormatter{})

logrus.SetFormatter(&logrus.JSONFormatter{
FieldMap: logrus.FieldMap{
logrus.FieldKeyLevel: "severity",
},
})

runtime.ErrorHandlers[0] = func(err error) {
if stackTrace, ok := err.(stackTracer); ok {
Expand Down

0 comments on commit e9d267d

Please sign in to comment.