From 2837370e2859fce7e6d2cd7095206c7806a73410 Mon Sep 17 00:00:00 2001 From: Benjamin Eder Date: Mon, 13 Mar 2023 19:17:16 +0100 Subject: [PATCH] feat: log more information for patching a resource (#2369) --- http/resource.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http/resource.go b/http/resource.go index 0d7c5366..c99a6dfa 100644 --- a/http/resource.go +++ b/http/resource.go @@ -11,6 +11,9 @@ import ( "path/filepath" "strings" + "golang.org/x/text/cases" + "golang.org/x/text/language" + "github.com/shirou/gopsutil/v3/disk" "github.com/spf13/afero" @@ -240,8 +243,9 @@ func resourcePatchHandler(fileCache FileCache) handleFunc { }, action, src, dst, d.user) if err == nil { + titleAction := cases.Title(language.English).String(action) audit.LogResourceActivity(audit.ResourceActivity{ - Event: "Patch", + Event: fmt.Sprintf("%v with destination %v", titleAction, dst), ResourcePath: r.URL.Path, User: d.user, })