feat(logs) add supports write logs to files (#217)

*  feat(logs) add supports write logs to files

* fix(lint) 🚨 fix go lint

* 🐛 fix(bug) check path is done only if provided

* 📝 doc(vars) add LogFilePath to vars

* 🦺 chore(review) update doc, configuration check and logger
This commit is contained in:
mathieuHa
2025-03-31 20:19:44 +02:00
committed by GitHub
parent a184ae6db9
commit 5418d35feb
7 changed files with 110 additions and 61 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ type Bouncer struct {
// New creates the crowdsec bouncer plugin.
func New(_ context.Context, next http.Handler, config *configuration.Config, name string) (http.Handler, error) {
log := logger.New(config.LogLevel)
log := logger.New(config.LogLevel, config.LogFilePath)
err := configuration.ValidateParams(config)
if err != nil {
log.Error("New:validateParams " + err.Error())