log when fifo fails to open

This commit is contained in:
Mahmood Ali 2019-04-01 11:29:02 -04:00
parent 54209489ef
commit 2b1f858e1b

View file

@ -223,6 +223,7 @@ func (l *logRotatorWrapper) start(readerOpenFn func() (io.ReadCloser, error)) {
reader, err := readerOpenFn()
if err != nil {
l.logger.Warn("failed to open log fifo", "error", err)
return
}
l.processOutReader = reader
@ -230,7 +231,7 @@ func (l *logRotatorWrapper) start(readerOpenFn func() (io.ReadCloser, error)) {
_, err = io.Copy(l.rotatorWriter, reader)
if err != nil {
l.logger.Error("copying got an error", "error", err)
l.logger.Warn("failed to read from log fifo", "error", err)
// Close reader to propagate io error across pipe.
// Note that this may block until the process exits on
// Windows due to