Logrus log messages not logged through pkg logger
Closed this issue · 1 comments
andrewemeryanz commented
Logs logged against the pkg
logger aren't forwarding on the message to logrus
:
# message logged against the `pkg` logger
time="2020-06-23T10:14:38+10:00" level=info func="github.com/anz-bank/sysl-go/core.(*logrusHook).OnLogged" file="/Users/Shared/Library/go/pkg/mod/github.com/anz-bank/sysl-go@v0.39.0/core/logging.go:16"
The issue appears to be that logrus overwrites the entry message:
func (h *logrusHook) OnLogged(entry *log.LogEntry) error {
e := pkgLogEntryToLogrusEntry(h.logger, entry)
e.Log(e.Level) // should be: e.Log(e.Level, e.Message)
return nil
}
andrewemeryanz commented
Fixed.