Make sure it's written to disk before we try reading the logs. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@@ -262,6 +262,7 @@ func (d *Daemon) LogFileName() string {
// ReadLogFile returns the content of the daemon log file
func (d *Daemon) ReadLogFile() ([]byte, error) {
+ _ = d.logFile.Sync()
return os.ReadFile(d.logFile.Name())
}