Skip to content

Commit

Permalink
fix json formatter error
Browse files Browse the repository at this point in the history
  • Loading branch information
jianfengye committed Nov 21, 2021
1 parent a7937e4 commit 43887f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/provider/log/formatter/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (

func JsonFormatter(level contract.LogLevel, t time.Time, msg string, fields map[string]interface{}) ([]byte, error) {
bf := bytes.NewBuffer([]byte{})
if fields == nil {
fields = map[string]interface{}{}
}
fields["msg"] = msg
fields["level"] = level
fields["timestamp"] = t.Format(time.RFC3339)
Expand Down

0 comments on commit 43887f1

Please sign in to comment.