Is there a way to stop deprecation errors from log...
# help
w
Is there a way to stop deprecation errors from logging in cloud environments? Now the logs are full of things like this:
"ErrorException - Since symfony/security-guard 5.3: The \"Symfony\\Component\\Security\\Guard\\Token\\PostAuthenticationGuardToken\" class is deprecated, use the new authenticator system instead
which makes finding actual problems very annoying.
👀 1
I tried setting
Copy code
$config[ErrorHandlerConstants::ERROR_LEVEL_LOG_ONLY] = E_DEPRECATED | E_USER_DEPRECATED;
to
Copy code
$config[ErrorHandlerConstants::ERROR_LEVEL_LOG_ONLY] = 0;
but I don't think it does what I thought it would do.
w
w
Where?
w
Instead of 0 as value you use one or a bitmask of PHP error constants as value
E.g.:
$config[ErrorHandlerConstants::ERROR_LEVEL_LOG_ONLY] = E_ERROR;
w
I don't see how that'll stop the logging though: \Spryker\Shared\ErrorHandler\ErrorHandlerEnvironment::setErrorHandler uses that configuration to decide whether to throw an exception or not, and then runs
Copy code
ErrorLogger::getInstance()->log($exception);
if not
w
Sorry, the configuration key was misleading me. Then I do not have a solution for you, especially as it is nearly impossible (or at least very hacky) to overwrite the Error Handler in Spryker.
👍 1
a
@mammoth-autumn-37948 may I post a project level fix to the problem you shared a while ago?
The problem isn't fixed in the core yet unfortunately. I'm poking our product and development teams from time to time with no luck unfortunately.
m
Yes i can. Tomorrow i will Post my Solution