Skip to content

Commit

Permalink
Merge pull request #287 from kacf/1.4.x
Browse files Browse the repository at this point in the history
MEN-1726: FIXED: Deployment logging is now written syncronously to fl…
  • Loading branch information
kacf authored May 7, 2018
2 parents c90161b + 50a5ec3 commit 5f1cab7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions deployment_logger.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017 Northern.tech AS
// Copyright 2018 Northern.tech AS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,7 +42,8 @@ type FileLogger struct {
// just before logging is started
func NewFileLogger(name string) *FileLogger {
// open log file
logFile, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0600)
logFile, err := os.OpenFile(name,
os.O_RDWR|os.O_CREATE|os.O_APPEND|os.O_SYNC, 0600)
if err != nil {
// if we can not open file for logging; return nil
return nil
Expand Down

0 comments on commit 5f1cab7

Please sign in to comment.