Skip to content

Commit

Permalink
serverless/appsec: use agent logger backend (#21446)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellzy authored Dec 11, 2023
1 parent ad51d4b commit 6a0adec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/serverless/appsec/appsec.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"math/rand"
"time"

appsecLog "github.com/DataDog/appsec-internal-go/log"
"github.com/DataDog/datadog-agent/pkg/serverless/appsec/config"
"github.com/DataDog/datadog-agent/pkg/serverless/appsec/httpsec"
"github.com/DataDog/datadog-agent/pkg/serverless/proxy"
Expand Down Expand Up @@ -161,3 +162,13 @@ func wafHealth() error {
func (a *AppSec) canExtractSchemas() bool {
return a.cfg.APISec.Enabled && a.cfg.APISec.SampleRate >= rand.Float64()
}

func init() {
appsecLog.SetBackend(appsecLog.Backend{
Trace: log.Tracef,
Debug: log.Debugf,
Info: log.Infof,
Errorf: log.Errorf,
Criticalf: log.Criticalf,
})
}

0 comments on commit 6a0adec

Please sign in to comment.