func logWriterScanner(logger *logrus.Logger, reader *io.PipeReader) { defer reader.Close() // 64k max per line buf := bufio.NewReaderSize(reader, 1024*64) for { line, _, err := buf.ReadLine() if err != nil { if err == io.EOF { break } logger.Errorf("Error while reading from Writer: %s", err) return } logger.Print(string(line)) } }