-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] enable ErrorHandler in prod #12062
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
Conversation
We haven't solved this issue at last 3 years and IMHO it is ok wait 6 month until 2.7 will be released. Last-minute rush can decrease quality of the sollution. Logging fatal errors would be better with stacktrace, but xdebug is so slow for production. What about thinking to this issue from other side? Is it possible create production-ready extension from this https://wiki.php.net/rfc/engine_exceptions RFC? |
The rush is relative: we have 2 months after feature freeze to finalize, and we have some experience enabling this feature in existing prod apps. |
@Koc The result of the poll was no. So I don't think that's so useful prepare something for it. |
d303503
to
0fa3ac0
Compare
So this is not WIP anymore:
When kernel.debug=false, no exception is thrown on error (same as today) but the already configured logger is called now, with screaming switched on for fatal errors (which means silenced fatal errors are logged but not the other silenced ones). |
|
} | ||
|
||
$this->addClassesToCompile(array( | ||
'Symfony\\Component\\Config\\FileLocator', | ||
'Symfony\\Component\\Debug\\ErrorHandler', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing empty line to keep consistency (group by component)
It seems good to me. |
9d725b1
to
5e43a69
Compare
f14c2d9
to
513c9a0
Compare
So, I switched myself in @stof mode. |
513c9a0
to
9fe9f49
Compare
@@ -133,8 +133,6 @@ public function load(array $configs, ContainerBuilder $container) | |||
if ($container->getParameter('kernel.debug')) { | |||
$loader->load('debug.xml'); | |||
|
|||
$definition->replaceArgument(0, array(new Reference('http_kernel', ContainerInterface::NULL_ON_INVALID_REFERENCE), 'terminateWithException')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is replaced by a dynamic fetch of the kernel in the configured listener service (see below): $event->getKernel()
👍 As ATM I'm using a TracyBundle for production debugging. Would gladly switch to Symfony only implementation. |
looks good to me. 👍 |
9fe9f49
to
4a40ff3
Compare
4a40ff3
to
631dfa9
Compare
631dfa9
to
4d0ab7d
Compare
Replaced by #12081 |
This is a first proposal for enabling error handling (mainly logging) in prod envs.
I'd like to make it for 2.6 but need help to make the best decisions.
@Koc worked on the subject but issue #8281 remains.
This misses configuration options for the ErrorHandler and for php ini settings related to error handling:
I'd like to allow apps to define any log channel per log level,
and I'd also like to be able to
ini_set('error_log', ...)
through symfony configuration system, withapp/logs/php.log
as default.WIP state, but early feedback welcomed. We have only a few days to make it.
https://github.com/symfony/symfony/pull/12062/files?w=1