Log incoming and outgoing requests #2294
Answered
by
RobinTail
marcelmatko
asked this question in
Q&A
-
Hi. I was wondering if it's possible to somehow log incoming requests (payload, headers, method, etc.) on a certain endpoint or all endpoints and then also outgoing requests (which are called in a service layer from the route handler). If so, how should I approach this? Thanks in advance :) |
Beta Was this translation helpful? Give feedback.
Answered by
RobinTail
Jan 9, 2025
Replies: 1 comment 9 replies
-
Sure, @marcelmatko . You'd need a middleware to log requests and a custom result handler to log responses.
|
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
RobinTail
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure, @marcelmatko . You'd need a middleware to log requests and a custom result handler to log responses.
Both entities have access to the
logger
argument in theirhandler
.Please refer to the corresponding documentation for examples: