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

Feature: Log response #14

Open
DanieliMi opened this issue Sep 29, 2023 · 4 comments
Open

Feature: Log response #14

DanieliMi opened this issue Sep 29, 2023 · 4 comments

Comments

@DanieliMi
Copy link
Member

It would be really nice to see the response that is sent for the request. Including the status code.

@amenk
Copy link
Member

amenk commented Sep 29, 2023

First of all, this plugin is called request logger :-)

But the idea is nice, especially concerning the status code.

As for logging the full response, this should be optional or capped to a limit, because responses sometimes can get really big. (requests can get big, too - but in common use cases I would say that most requests are much smaller than the responses)

@amenk amenk changed the title Feature: Log reponse Feature: Log response Sep 29, 2023
@DanieliMi
Copy link
Member Author

I think a config option to turn on response logging would be nice.

@amenk
Copy link
Member

amenk commented Sep 29, 2023

Yes, but maybe something more differentiated, for example to log the response only for certain status codes and/or for certain content types.

@DanieliMi
Copy link
Member Author

The config could be something like

log_response_for => [
    'status_codes' => [422, 500],
    'content_types' => ['application/json', 'application/xml'],
],

Then you can filter both by status code and content_type. If you would like to log everything I'd say passing ['*'] could be a good option.

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