Skip to content

Commit

Permalink
Merge pull request #15 from spotlibs/fix/use-log-for-middleware-activity
Browse files Browse the repository at this point in the history
fix: use `log` for middleware activity monitor
  • Loading branch information
mdanialr authored Sep 23, 2024
2 parents 1ee55af + f938d90 commit 72f0760
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 72f0760

Please sign in to comment.