Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging raw response #84

Open
skluz opened this issue Sep 30, 2024 · 1 comment
Open

logging raw response #84

skluz opened this issue Sep 30, 2024 · 1 comment

Comments

@skluz
Copy link

skluz commented Sep 30, 2024

I don't see a way to get to the processing chain after Renderer is called. Is there any way to log the raw response?

@angryziber
Copy link
Member

angryziber commented Dec 13, 2024

That can be done from inside a custom Renderer if needed.

Existing renderers, like JsonBody stream response to the client to optimize memory usage.

If you need to log it, you need to render to a memory buffer first (ByteArray or String), then log it and also send to the client. This will increase memory usage and GC work, so not ideal for production.

Another option is to log controller result (most likely Kotlin data class) before rendering it to json.
That can be done from both a custom Renderer or a RequestLogger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants