Access API response time for logging purposes #12822
Unanswered
asieraduriz
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I've been using payload for a year and I'm very happy with it's performance.
Now that our product is kicking off, I want to make sure that my Payload CMS instance is still performing at a level according to our performance metrics, and I see there are logs within the console of Payload CMS, however, I haven't been successful in accessing them.
I've created a custom middleware.js file
I've realised that with this implementation I cannot do a time difference because
NextResponse.next
is a non-blocking instruction.However, when I look over at the terminal logs coming out of Payload I see for every API there's the time it takes for the instance to respond:
GET /api/posts/3?depth=2&draft=false&locale=en 200 in 31ms
Is there a way for me to access those response times to log them?
Beta Was this translation helpful? Give feedback.
All reactions