yii2 icon indicating copy to clipboard operation
yii2 copied to clipboard

add `_REQUEST_BODY` when set request parse the log file _POST is empty data

Open easydowork opened this issue 2 years ago • 1 comments

add _REQUEST_BODY when set request parse the log file _POST is empty data

Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️

easydowork avatar Jun 06 '22 07:06 easydowork

Thank you for putting effort in the improvement of the Yii framework. We have reviewed your pull request.

Unfortunately a use case is missing. It is required to get a better understanding of the pull request and helps us to determine the necessity and applicability of the suggested change to the framework.

Could you supply us with a use case please? Please be as detailed as possible and show some code!

Thanks!

This is an automated comment, triggered by adding the label pr:missing usecase.

yii-bot avatar Jun 06 '22 08:06 yii-bot

@easydowork it can be useful for requests which don't populate $_POST, but:

  • it should be configurable and disabled by default
  • it shouldn't be redundant (getBodyParams() returns raw + parsed; also, falls back to $_POST in some cases)
  • getBodyParams() throws InvalidConfigException which should be avoided in log Target, you should access raw data directly
  • it crashes logging on console app because method exist only in web Request

If you are willing to refine idea, you can implement custom callbacks for appending data to context message and than you can define your callback on project level without extending class.

MarkoNV avatar Oct 19 '22 07:10 MarkoNV

I agree and closing this PR. Thank you for your time though.

bizley avatar Oct 19 '22 10:10 bizley