So when using Logrus I need the logging output to have the message
key instead of msg
key, but when I use the code below I get both, but msg
is empty, how can I configure logrus to use 'message' instead of 'msg'?
contextLogger.WithField("logger_name",topic).WithField("message",messageString).Info()
Here's the log output when leaving .Info()
empty // .Info()
logs to the msg
key
"logger_name": "logger","message": "log message","msg": "","time": "2020-08-12T15:14:48Z"
What I would like is to be able to use .Info(message)
and have
"logger_name": "logger","message": "log message","time": "2020-08-12T15:14:48Z"
Is it possible to change default logging keys for .Info() etc?