Closed echupriyanov closed 8 years ago
I'm trying to use preset *logrus.Entry with a "rag" field, so I don't have to specify tag on each log message. Example:
*logrus.Entry
hook := logrus_fluent.NewHook("fluent-es-dev.cybertonica.aws", 24224) myLogger := logrus.New() myLogger.Hooks.Add(hook) myLogger.Formatter = new(logrus.JSONFormatter) myLogger.Level = logrus.DebugLevel myLog := myLogger.WithFields(logrus.Fields{"tag": "debug.scratch.test", "host": "iMac-eric"}) myLog.Debug("First message") myLog.Debug("Second message")
First message is correctly tagged and sent to Fluentd, but second one is un-tagged.
I suggest to make a copy of entry's data in Fire call work with it, but not with original entry passed
Fire
merged #6
I'm trying to use preset
*logrus.Entry
with a "rag" field, so I don't have to specify tag on each log message. Example:First message is correctly tagged and sent to Fluentd, but second one is un-tagged.
I suggest to make a copy of entry's data in
Fire
call work with it, but not with original entry passed