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

exception.log missing #36054

Closed
1 of 5 tasks
siliconalchemy opened this issue Aug 30, 2022 · 53 comments
Closed
1 of 5 tasks

exception.log missing #36054

siliconalchemy opened this issue Aug 30, 2022 · 53 comments
Labels
Area: Install & Administer Area: UI Framework Component: Exception Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.5 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@siliconalchemy
Copy link

Preconditions and environment

  • Magento version 2.4.5
  • PHP 8.1 (FPM)
  • Apache2.4
  • Ubuntu 20.04

This Magento install has

Steps to reproduce

Trigger an exception/error (for example reCAPTCHA error detailed in #34975), or make generated/ directory read-only to trigger a read-only error.

Expected result

I expect to see an error and trace in var/log/exception.log

Actual result

No exception.log exists. Errors do seem to appear in system.log, but I don't know if they are everything that should be in exception.log.

Additional information

This instance of Magento has been updated since 2.0 to 2.2 and 2.4. In the past exception.log was always present with errors/exceptions.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Aug 30, 2022

Hi @siliconalchemy. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 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.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@engcom-Dash engcom-Dash added the Reported on 2.4.5 Indicates original Magento version for the Issue report. label Sep 1, 2022
@amokato
Copy link

amokato commented Sep 5, 2022

We have the same issue since 2.4.3-p1 / 2.4.4

@adriansanta
Copy link

Same here. 2.4.4 EE. We suspect there is a gap between the preg_match used in module-support and some new log formatting. The matching expressions might need an update to start working correctly again.

@kamephis
Copy link

kamephis commented Sep 8, 2022

We tested that on a vanilla 2.4.4 (Community) in the exception.log is not written there. Would be nice to get some feedback from Magnet here. It's difficult to debug stuff when there is no clue about what happens.

@amokato
Copy link

amokato commented Sep 23, 2022

Any updates on this? Nobody seems to care about such a severe issue.

@hostep
Copy link
Contributor

hostep commented Sep 23, 2022

@sdzhepa: can we have somebody to verify this? This indeed sounds like a P0 or P1 prio if it's true. Thanks!

I can not confirm that this is true on Magento 2.4.3-p3 on production shops of ours, it works as expected over there. We haven't tried 2.4.4 or 2.4.5 yet in production, so I can't speak about those versions yet.

@amokato
Copy link

amokato commented Sep 23, 2022

We're having this issue on 2.4.4 (CE). It seems that some errors are written to the system.log.

@kamephis
Copy link

In our case the exceptions seem to be written into the system.log instead of the exception.log (2.4.4 CE). The exception.log stays empty.

@engcom-November engcom-November self-assigned this Sep 30, 2022
@m2-assistant
Copy link

m2-assistant bot commented Sep 30, 2022

Hi @engcom-November. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf 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 branch

    Details- 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.

@engcom-November
Copy link
Contributor

Verified the issue on fresh instance of 2.4.5 Project-community-edition and the issue is reproducible. exception.log file is missing in var/log folder. No errors are written into exception.log. Only all errors are written into system.log file.
Note: There is no issue when the Magento is upgraded to 2.4.5 from 2.4.3 Project-community-edition. exception.log file is present in this case and all the errors/exceptions are getting written into exception.log file as expected.
Hence confirming this issue.

@engcom-November engcom-November added Component: Exception Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Install & Administer Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Sep 30, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-6796 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Sep 30, 2022

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-November engcom-November added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Sep 30, 2022
@onlinebizsoft
Copy link

We also re-look at this one as well
#13128

@engcom-Hotel
Copy link
Contributor

Hello,

As I can see this issue got fixed in the scope of the internal Jira ticket ACP2E-1287 by the internal team
Related commits: https://github.com/magento/magento2/search?q=ACP2E-1287&type=commits

Based on the Jira ticket, the target version is 2.4.6.

Thanks

@hostep
Copy link
Contributor

hostep commented Jan 2, 2023

If anyone wants a patch based on the commits from above (which work on Magento 2.4.5, haven't tested on 2.4.4), this one can be applied against the magento/framework composer package:
ACP2E-1287-Framework.txt

@UglyWillDuckling
Copy link

If anyone wants a patch based on the commits from above (which work on Magento 2.4.5, haven't tested on 2.4.4), this one can be applied against the magento/framework composer package: ACP2E-1287-Framework.txt

Thanks for the patch.

@andy-igoo
Copy link

Just a quick note to say this worked for me: https://magento.stackexchange.com/questions/361276/exception-log-is-missing-in-magento2-4-4

--- a/vendor/magento/framework/Logger/Handler/System.php
+++ b/vendor/magento/framework/Logger/Handler/System.php
@@ -55,7 +55,7 @@
      */
     public function write(array $record): void
     {
-        if (isset($record['context']['exception'])) {
+        if (isset($record['context']['exception']) || $record['level'] == Logger::CRITICAL) {
             $this->exceptionHandler->handle($record);

             return;

@Eddcapone
Copy link

Eddcapone commented Jun 28, 2023

@engcom-Hotel

Hello,

As I can see this issue got fixed in the scope of the internal Jira ticket ACP2E-1287 by the internal team Related commits: https://github.com/magento/magento2/search?q=ACP2E-1287&type=commits

Based on the Jira ticket, the target version is 2.4.6.

Thanks

Is there a patch available or do we have to wait until 2.4.6?

@siliconalchemy
Copy link
Author

2.4.6 is out and includes this patch/fix.

@Eddcapone
Copy link

@siliconalchemy So we have to upgrade to 2.4.6 to fix it?

@MeetKamal
Copy link

Hi @Eddcapone - For the temp purpose you can try the below solution
https://magento.stackexchange.com/questions/361276/exception-log-is-missing-in-magento2-4-4

We tried that and it seems working.

@Eddcapone
Copy link

@MeetKamal But this requires us to do a change in the core. Why is there no official patch?

@vardhmankamani1
Copy link

@Eddcapone Here i am attach the patch file, you can use this patch untill the your system is not being updated to the 2.4.6
exception_log.zip

@hostep
Copy link
Contributor

hostep commented Jun 29, 2023

Or use my earlier referenced patch that is based on the official Adobe fix? (A lot time of could have been won if you just had read all the comments in this thread 😉)

@Eddcapone
Copy link

Eddcapone commented Jun 29, 2023

My question is wether there is an official patch and if not why not?

@hostep
Copy link
Contributor

hostep commented Jun 29, 2023

There isn't as far as I know, at least I can't find one when searching using their quality patches tool. As to why not, no idea, but probably Adobe didn't feel like it was important enough to create one...

So either take one of the solutions here from the thread, or make one yourself if you don't trust it (which is what I would recommend), or upgrade to 2.4.6-p1, or if you really want an official patch, create an issue or pull request here: https://github.com/magento/quality-patches (but knowing Adobe, it might take some weeks/months/years until you'll get one)

@Eddcapone
Copy link

Eddcapone commented Jun 30, 2023

@hostep, Thx! It is beyond me how there is no official patch for such an important bug
CC @engcom-Hotel

@Eddcapone
Copy link

Eddcapone commented Jul 27, 2023

Or use my earlier referenced patch that is based on the official Adobe fix? (A lot time of could have been won if you just had read all the comments in this thread 😉)

I tried your patch. I copied it to vendor/magento/framework and executed git apply exception_loggin.patch.
But the exception.log is still not getting generated even though I have a server error.

@moazzama
Copy link

moazzama commented Jan 8, 2024

diff --git a/vendor/magento/framework/Logger/Handler/System.php b/vendor/magento/framework/Logger/Handler/System.php
index ff57ae87..a6f6b91a 100644
--- a/vendor/magento/framework/Logger/Handler/System.php
+++ b/vendor/magento/framework/Logger/Handler/System.php
@@ -55,7 +55,7 @@ class System extends Base
      */
     public function write(array $record): void
     {
-        if (isset($record['context']['exception'])) {
+        if (isset($record['context']['exception']) || $record['level'] == Logger::CRITICAL) {
             $this->exceptionHandler->handle($record);
 
             return;

@Eddcapone
Copy link

Is there a patch already?

@moazzamsali
Copy link

Is there a patch already?

No I created the new one because on my site exception logs were not creating

@Eddcapone
Copy link

Why do they close it if there is no official patch?

@hostep
Copy link
Contributor

hostep commented Jan 10, 2024

@Eddcapone: it was fixed in Magento 2.4.6, so why shouldn't they close it?
As for a patch, I mentioned one over here: #36054 (comment)

@Eddcapone
Copy link

Eddcapone commented Jan 16, 2024

@hostep Because not everyone can just upgrade to 2.4.6, it is a long process if you have many third party extensions and customisations. And your patch is not official.

@hostep
Copy link
Contributor

hostep commented Jan 16, 2024

😆 In that thought process they need to leave open every ticket for forever and never close one, because there will always be a user that can't update to some version.

Anyway, if a fix has been published, they close the issue, it's as simple as that.

My patch isn't official, that's very true, if you don't trust it, then please make your own patch, the commits with fixes were already mentioned earlier: #36054 (comment)

There is no other way you'll get what you want, so please get into the habit of creating your own patches for bugs you need to have fixed, you're bound to run into another bug in the future that has been fixed in some commit, so it's a good skill to have to turn those commits into patches.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Install & Administer Area: UI Framework Component: Exception Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.5 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Archived in project
Development

No branches or pull requests