Skip to content

Commit

Permalink
Merge pull request #61 from ochinchina/master
Browse files Browse the repository at this point in the history
/dev/stdout & /dev/stderr as LogFileName
  • Loading branch information
deniszh authored Jul 27, 2021
2 parents 3fdf7dc + 373ea6d commit 5d287a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion daemon_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ func (d *Context) openFiles() (err error) {
}

if len(d.LogFileName) > 0 {
if d.logFile, err = os.OpenFile(d.LogFileName,
if d.LogFileName == "/dev/stdout" {
d.logFile = os.Stdout
} else if d.LogFileName == "/dev/stderr" {
d.logFile = os.Stderr
} else if d.logFile, err = os.OpenFile(d.LogFileName,
os.O_WRONLY|os.O_CREATE|os.O_APPEND, d.LogFilePerm); err != nil {
return
}
Expand Down

0 comments on commit 5d287a5

Please sign in to comment.