diff --git a/pkg/util/exec/exec.go b/pkg/util/exec/exec.go index 718b40632bcf..bed06788aca5 100644 --- a/pkg/util/exec/exec.go +++ b/pkg/util/exec/exec.go @@ -247,11 +247,16 @@ func startCommand(env []string, command string, arg ...string) (*exec.Cmd, io.Re // read from reader line by line and write it to the log func logFromReader(logger *capnslog.PackageLogger, reader io.ReadCloser) { + l := logger.Debug + // If we are an OSD we must log using Info to print out stdout/stderr + if os.Getenv("ROOK_OSD_ID") != "" { + l = logger.Info + } in := bufio.NewScanner(reader) lastLine := "" for in.Scan() { lastLine = in.Text() - logger.Debug(lastLine) + l(lastLine) } }