0

While exception is generated the exception.log file is missing inside the var/log folder.

1 Answer 1

1

@Vardhman Kamani

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);
    }

Thank you.

3
  • Hello @SamirShaikh It's working for me. Thank you! Commented Oct 31, 2022 at 14:06
  • Hi @VardhmanKamani Fine, Thanks for the response :) Commented Nov 1, 2022 at 8:57
  • Does not work. Tested with 2.4.4-p3
    – Black
    Commented Jul 28, 2023 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.