Skip to content

Commit

Permalink
fix: use log for middleware activity monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanialr committed Sep 23, 2024
1 parent 1ee55af commit f938d90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions middleware/activity_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/goravel/framework/contracts/http"
"github.com/goravel/framework/facades"
"github.com/spotlibs/go-lib/ctx"
"github.com/spotlibs/go-lib/log"
)

// ActivityMonitor capture and log all request/response.
Expand Down Expand Up @@ -58,9 +59,8 @@ func apiActivityRecorder(c http.Context, start time.Time) {
"requestAt": start.Format(time.RFC3339Nano),
//"memoryUsage": // coming soon
}
st, _ := sonic.ConfigFastest.MarshalToString(activityData)
// currently only log to stdout
println(st)

log.Activity(c).Info(activityData)
}

// captureRequestMap capture request as map and transform it to json string.
Expand Down

0 comments on commit f938d90

Please sign in to comment.