Could you please advise how I can write simultaneously to stdout and log file?
Is it possible? From the description, it is not obvious and I can't find correspondent method.
You should try io.MultiWriter
mw := io.MultiWriter(os.Stdout, logFile)
logrus.SetOutput(mw)
Great, thank you very much!!!
please add to docs
The downside is that you have to stick to the same formatter for both files... :(
@fser - I solved having different formatters for stdout and the log file using this snippet: https://github.com/sirupsen/logrus/issues/784#issuecomment-403765306
@kramer65 How did you accomplish two different formatters using vanilla logrus? (ie: without rotatefilehook)
Most helpful comment
You should try io.MultiWriter