Append to debug log files, don't clobber.

This commit is contained in:
Sean Chittenden 2016-10-18 13:08:23 -07:00
parent 6d1e7ab1eb
commit b1c3649eac
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"log"
"os"
"strings"
"syscall"
"github.com/hashicorp/logutils"
)
@ -31,7 +32,7 @@ func LogOutput() (logOutput io.Writer, err error) {
logOutput = os.Stderr
if logPath := os.Getenv(EnvLogFile); logPath != "" {
var err error
logOutput, err = os.Create(logPath)
logOutput, err = os.OpenFile(logPath, syscall.O_CREAT|syscall.O_RDWR|syscall.O_APPEND, 0666)
if err != nil {
return nil, err
}