Append to log file if it exists
This commit is contained in:
parent
736f37cb58
commit
e33bd6874f
1 changed files with 1 additions and 1 deletions
|
@ -49,7 +49,7 @@ func getLogWriter(staticConfiguration *static.Configuration) io.Writer {
|
||||||
var w io.Writer = os.Stderr
|
var w io.Writer = os.Stderr
|
||||||
|
|
||||||
if staticConfiguration.Log != nil && len(staticConfiguration.Log.FilePath) > 0 {
|
if staticConfiguration.Log != nil && len(staticConfiguration.Log.FilePath) > 0 {
|
||||||
_, _ = os.Create(staticConfiguration.Log.FilePath)
|
_, _ = os.OpenFile(staticConfiguration.Log.FilePath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o666)
|
||||||
w = &lumberjack.Logger{
|
w = &lumberjack.Logger{
|
||||||
Filename: staticConfiguration.Log.FilePath,
|
Filename: staticConfiguration.Log.FilePath,
|
||||||
MaxSize: staticConfiguration.Log.MaxSize,
|
MaxSize: staticConfiguration.Log.MaxSize,
|
||||||
|
|
Loading…
Reference in a new issue