x-cray / logrus-prefixed-formatter

Logrus Prefixed Log Formatter
MIT License
199 stars 107 forks source link

Position of msg field #17

Closed AndreKR closed 7 years ago

AndreKR commented 7 years ago

In logrus.TextFormatter, the msg field is always the third field (after time and level).

This makes sense because the other tags are probably additional information about the error, compare:

time="2017-06-28T13:37:18+02:00" level=fatal msg="Can't open file" filename="/usr/local/share/man" 

vs

time="2017-06-28T13:37:18+02:00" level=fatal filename="/usr/local/share/man" msg="Can't open file"

In prefixed.TextFormatter it is always at the end, which in my opinion makes the log more difficult to read.

x-cray commented 7 years ago

Indeed, makes sense. I'll change that.