mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-13 09:32:24 -06:00
Append to debug log files, don't clobber.
This commit is contained in:
parent
6d1e7ab1eb
commit
b1c3649eac
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user