From d780a73297dc7de14dea4e8a82c0394d6a6704a4 Mon Sep 17 00:00:00 2001 From: sadayuki-matsuno Date: Thu, 7 Oct 2021 00:00:01 -0700 Subject: [PATCH] add log json option (#1317) --- detector/cve_client.go | 2 +- logging/logutil.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/detector/cve_client.go b/detector/cve_client.go index dd84ae0a..7e2174b9 100644 --- a/detector/cve_client.go +++ b/detector/cve_client.go @@ -27,7 +27,7 @@ type goCveDictClient struct { } func newGoCveDictClient(cnf config.VulnDictInterface, o logging.LogOpts) (*goCveDictClient, error) { - if err := cvelog.SetLogger(o.LogToFile, o.LogDir, o.Debug, false); err != nil { + if err := cvelog.SetLogger(o.LogToFile, o.LogDir, o.Debug, o.LogJSON); err != nil { return nil, err } diff --git a/logging/logutil.go b/logging/logutil.go index ed393cbe..5d1fae4c 100644 --- a/logging/logutil.go +++ b/logging/logutil.go @@ -22,6 +22,7 @@ type LogOpts struct { DebugSQL bool `json:"debugSQL,omitempty"` LogToFile bool `json:"logToFile,omitempty"` LogDir string `json:"logDir,omitempty"` + LogJSON bool `json:"logJSON"` Quiet bool `json:"quiet,omitempty"` }