Skip to content

Commit

Permalink
Remove hard-coded 0600 log file perms (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarppiko committed Jun 7, 2023
1 parent 3d3cb8a commit a31e532
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pkg/cfg/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import (
"fmt"
"io"
"os"
"path/filepath"

log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus/hooks/writer"
"gopkg.in/natefinch/lumberjack.v2"

"github.com/crowdsecurity/go-cs-lib/pkg/logtools"
)

type LoggingConfig struct {
Expand All @@ -27,10 +26,8 @@ func (c *LoggingConfig) LoggerForFile(fileName string) (io.Writer, error) {
return os.Stderr, nil
}

logPath, err := logtools.SetLogFilePermissions(c.LogDir, fileName)
if err != nil {
return nil, err
}
// rely on lumberjack to create log file during first write
logPath := filepath.Join(c.LogDir, fileName)

l := &lumberjack.Logger{
Filename: logPath,
Expand Down

0 comments on commit a31e532

Please sign in to comment.