diff --git a/internal/handler/main.go b/internal/handler/main.go index 4ba390d..db7bf2a 100644 --- a/internal/handler/main.go +++ b/internal/handler/main.go @@ -384,7 +384,6 @@ func (h *Messaging) deleteExistingFactsBySource(apiClient graphql.Client, enviro return err } - //log.Printf("Previous facts deleted for '%s:%s' and source '%s'", project.Name, environment.Name, source) slog.Info("Previous facts deleted", "ProjectId", project.Id, "ProjectName", project.Name, diff --git a/main.go b/main.go index 02fe21f..9c23bca 100644 --- a/main.go +++ b/main.go @@ -100,6 +100,7 @@ func main() { disableS3Upload = getEnvBool("INSIGHTS_DISABLE_S3_UPLOAD", disableS3Upload) problemsFromSBOM = getEnvBool("PROBLEMS_FROM_SBOM", problemsFromSBOM) trivyServerEndpoint = getEnv("TRIVY_SERVER_ENDPOINT", trivyServerEndpoint) + enableDebug = getEnvBool("ENABLE_DEBUG", enableDebug) // First we set up the default logger for the project // If we enable debugging, we set the logging level to output debug for the default logger. @@ -109,7 +110,7 @@ func main() { debugLevel = slog.LevelDebug } - slog.SetDefault(slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{ + slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{ Level: debugLevel, })))