Open Hexmage opened 2 years ago
Hi @Hexmage. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-Lima. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@Hexmage Do these exceptions happen much more than Luma's? is logging just adding to how fast a request can respond? how would we identify all exceptions that are "is client safe"? Why would logging in own logfile be better? I am looking for a 1-2 week dev time solution.
@cpartica If a Luma Magento 2 shop is configured correctly, you rarely have an exception log. On a PWA shop its filled with messages like: Customer couldn't log in, product is out of stock, quote is inactive, shipping method is missing. All these messages wouldn't result in exceptions on a Luma store, because they are functional exception instead of breaking exceptions.
The reason I would like it to be logged in a different file is to make the other "real" exceptions in the exception log more visible and easier identifiable.
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hello @Hexmage,
thank you for reporting the issue.
Although I understood the issue and reference, for confirming this issue, we would like to generate some generic exceptions which you are referring to for better understanding of your concern.
Here is what I tried to do on Magento 2.4-develop with GraphQL as per your description example:
Based on the above points, can you please check and help us with reproducing the generic GraphQL exceptions that are getting logged in the exception.log file?
Thanks
@engcom-Hotel This is the error I'm receiving when I try to login through graphql.
[2022-07-19 13:38:54] main.ERROR: The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later. {"exception":"[object] (GraphQL\\Error\\Error(code: 0): The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later. at ../application/vendor/webonyx/graphql-php/src/Error/Error.php:174, Magento\\Framework\\GraphQl\\Exception\\GraphQlAuthenticationException(code: 0): The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later. at ../vendor/magento/module-customer-graph-ql/Model/Resolver/GenerateCustomerToken.php:59, Magento\\Framework\\Exception\\AuthenticationException(code: 0): The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later. at ../vendor/magento/module-integration/Model/CustomerTokenService.php:95)"} []
Hi @Hexmage,
Thank you for providing this info.
I am able to get this info in debug.log. Now it seems appropriate to log this information in debug.log and not in exception.log. And since it is not getting logged in exception.log so ‘real’ exceptions are visible which you thought is better. So the current flow seems fine.
Now based on this, do you think it should not be logged in the debug.log file as well? And please update which version of Magento you are getting this in the exception.log file? Please check and advise.
Thanks
@engcom-Hotel I'm still on 2.4.2 for this particular client. So if it moves to the debug log it's already an improvement.
Honestly I think these exceptions should only be logged in files with a debug config or when the shop is in developer mode. Because it is very rare that you actually want to use them. As an example when the non GraphQl endpoints trigger these exceptions they aren't logged either.
Hello @Hexmage,
Thanks for the reply!
For now, we are putting this issue on hold for PO confirmation.
Thanks
Hello @Hexmage,
We are moving this ticket as feature request for further processing.
Thanks
@magento give me 2.4.4 instance
Hi @Viktorja1. Thank you for your request. I'm working on Magento instance for you.
Hi @Viktorja1, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
any progress here?
With this graphql have his own log file, just put in any di.xml file and deploy
<virtualType name="[Vendor]\[Module]\Logger\Logger" type="Monolog\Logger">
<arguments>
<argument name="name" xsi:type="string">graphql</argument>
<argument name="handlers" xsi:type="array">
<item name="system" xsi:type="object">[Vendor]\[Module]\Logger\Handler</item>
</argument>
</arguments>
</virtualType>
<virtualType name="[Vendor]\[Module]\Logger\Handler" type="Magento\Framework\Logger\Handler\Base">
<arguments>
<argument name="fileName" xsi:type="string">/var/log/graphql.log</argument>
<argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
</arguments>
</virtualType>
<type name="\Magento\Framework\GraphQl\Query\ErrorHandler">
<arguments>
<argument name="logger" xsi:type="object">[Vendor]\[Module]\Logger\Logger</argument>
</arguments>
</type>
Summary (*)
Every exception thrown by the graphql endpoint is logged in the exception log. Even though they are functional exceptions that are used to make the frontend work. Because these exceptions are so common, they fill up the exception.log very fast making finding breaking exceptions a lot more cumbersome. The same scenarios through the regular frontend or the api's would not appear in the exception.log.
Examples (*)
As an example when a customer fails to login because they entered an invalid password, it triggers an exception which is logged in the exception.log.
Proposed solution
Don't automatically log the GraphQl "is client safe" exceptions to the exception.log. Either move this to it's own log and/or add a debug option to the backend.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.