From 704fd401bee92ea1e8fc7e6135f76106b6c1f282 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Wed, 5 Jul 2023 14:43:33 +0100 Subject: [PATCH] policy/opa: use Veraison logging Use Veraison logging framework for logging OPA engine output. Signed-off-by: Sergei Trofimov --- policy/opa.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/policy/opa.go b/policy/opa.go index c62742f1..cc5e7dce 100644 --- a/policy/opa.go +++ b/policy/opa.go @@ -8,11 +8,11 @@ import ( "encoding/json" "errors" "fmt" - "log" "github.com/open-policy-agent/opa/rego" "github.com/spf13/viper" "github.com/veraison/ear" + "github.com/veraison/services/log" ) var ErrBadOPAResult = errors.New("bad result update from policy") @@ -59,7 +59,7 @@ func (o *OPA) Evaluate( rego.Module("policy.rego", policy), rego.Input(input), rego.Query("outcome"), - rego.Dump(log.Writer()), + rego.Dump(log.NamedWriter("opa", log.DebugLevel)), ) resultSet, err := rego.Eval(ctx)