From 6a0adecd15e296b56d25bccf1bda6abce03b3ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mazeau?= Date: Mon, 11 Dec 2023 14:53:10 +0100 Subject: [PATCH] serverless/appsec: use agent logger backend (#21446) --- pkg/serverless/appsec/appsec.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/serverless/appsec/appsec.go b/pkg/serverless/appsec/appsec.go index 64f9d49f11ea2..1b26a5fad3237 100644 --- a/pkg/serverless/appsec/appsec.go +++ b/pkg/serverless/appsec/appsec.go @@ -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" @@ -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, + }) +}