diff --git a/base/logging.go b/base/logging.go index 5e77b7b420..3bfef17a47 100644 --- a/base/logging.go +++ b/base/logging.go @@ -422,6 +422,10 @@ func AuditLogContents(t testing.TB, f func(t testing.TB)) []byte { // Temporarily override logger output b := &bytes.Buffer{} mw := io.MultiWriter(b, os.Stderr) + + FlushLogBuffers() + auditLogger.FlushBufferToLog() + auditLogger.logger.SetOutput(mw) defer func() { auditLogger.logger.SetOutput(os.Stderr) }()