Closed siliconalchemy closed 1 year ago
Hi @siliconalchemy. 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.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
We have the same issue since 2.4.3-p1 / 2.4.4
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.
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.
Any updates on this? Nobody seems to care about such a severe issue.
@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.
We're having this issue on 2.4.4 (CE). It seems that some errors are written to the system.log.
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.
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: :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.
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.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6796 is successfully created for this GitHub issue.
:white_check_mark: 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.
Hi @siliconalchemy ,
Reviewed the issue again and after internal discussion, it has been concluded that this is not an issue. Magento has changed the way to write into exception.log File.
To print the log in exception.log, exception
parameters must be given in context.
@engcom-November - Ah! Haha that's a really funny april fools joke!!
Oh wait, it's the middle of October, it's not April 1st.
THIS IS A BUG
var/log/exception.log is a well established log for critical errors. This is not about custom code/modules, user logging. This is fundamental, built in logging from standard usage of Magento. References to it are littered throughout the official Magento documentation. Have a look.
THIS IS A BUG
eg.
https://devdocs.magento.com/cloud/project/log-locations.html
Exception log: var/log/exception.log
https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/cli/configure-cron-jobs.html
Jobs with an ERROR status are always logged as CRITICAL in <install_directory>/var/log/exception.log.
etc etc
100% agree with @siliconalchemy
Having all kind of log severities in the same file (system.log) really makes it difficult to use and defeats the purpose of log severity in the first place. We have to employ various workarounds (like parsing rules) to filter out "noise" lines in order to have a realistic overview of actual issues.
Furthermore, exception.log is not populated not only by custom/third party code, but also by Magento core code itself.
At least we could expect from core team to list this so-called "feature" in their release notes, as a backwards incompatible change. But ideally, this should be fixed to work as in the previous versions.
I agree, this is by far not a feature. Please take your time and fix this. It has been month and nothing happened.
Yes, we are also experiencing this same issue. So does 2.4.5 upgrade fix this?
This needs to be fixed asap. do you know how many sites are trying to get updated to 2.4.4 or 2.4.5 by 11/28? Lots... They all need that exception.log to be working like it is stated to work and how it has always worked.
Hello @siliconalchemy @adriansanta @kamephis @jurvi @briangmoore77, We have discussed this issue again internally and after further analysis came across the below commit: https://github.com/magento/magento2/commit/8e6aedc8130be01669b04f99c19ab3f48e4c0691 We are confirming this issue and further analysis is in progress. Thank you.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-6796
Hello @engcom-November - We are facing same issue. Do we have any temp solution to enable exception.log, As lots of client facing issues.
I would be also interested in a temp solution if such exists, two clients are now missing exception.log making problem debugging unnecessarily harder.
@MeetKamal
We have verified this issue in our local environment and found work around(temporary) solution for it.
File path where need to replace core code: vendor/magento/framework/Logger/Handler/System.php
Please replace below code:
public function write(array $record): void
{
if (isset($record['context']['exception'])) {
$this->exceptionHandler->handle($record);
return;
}
$record['formatted'] = $this->getFormatter()->format($record);
parent::write($record);
}
With :
public function write(array $record): void
{
if (isset($record['context']['exception']) || $record['level'] == Logger::CRITICAL) {
$this->exceptionHandler->handle($record);
return;
}
$record['formatted'] = $this->getFormatter()->format($record);
parent::write($record);
}
Hi @Shaikh-Samir - Thank you for the Work around, Have tested and it seems working :)
Is this going backwards? I figured this would be fixed by now.
Still no exception.log in M2.4.5-p1
Still no exception.log in M2.4.5-p1
Hello @PaperDS We have tested this work around solution in M2.4.5-p1 as well and its working correctly in our project.
Thank you.
@
Still no exception.log in M2.4.5-p1
Hello @PaperDS We have tested this work around solution in M2.4.5-p1 as well and its working correctly in our project.
Thank you.
I've applied your work around and it works perfectly. Many thanks. I just don't like editing core code :-)
This might be fixed under ACP2E-1287: log exception to exception.log (untested), unfortunately no clean merge commit, so you'll probably want to add those 4 separate commits together in a patch.
@
Still no exception.log in M2.4.5-p1
Hello @PaperDS We have tested this work around solution in M2.4.5-p1 as well and its working correctly in our project. Thank you.
I've applied your work around and it works perfectly. Many thanks. I just don't like editing core code :-)
@PaperDS Yes got your point, its not best practice to edit in core code of framework, actually i also don't like to do this. So that mentioned it work around fix (as temporary solution). And if don't want to change in core magneto files then you can also create one patch for those changes and install.
We also re-look at this one as well https://github.com/magento/magento2/issues/13128
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
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
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.
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;
@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?
2.4.6 is out and includes this patch/fix.
@siliconalchemy So we have to upgrade to 2.4.6 to fix it?
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.
@MeetKamal But this requires us to do a change in the core. Why is there no official patch?
@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
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 😉)
My question is wether there is an official patch and if not why not?
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)
@hostep, Thx! It is beyond me how there is no official patch for such an important bug CC @engcom-Hotel
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.
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;
Is there a patch already?
Is there a patch already?
No I created the new one because on my site exception logs were not creating
Why do they close it if there is no official patch?
Preconditions and environment
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