8000 Missing prod debug handler · Issue #11053 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Missing prod debug handler #11053

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

Closed
nicolas-grekas opened this issue Jun 4, 2014 · 6 comments
Closed

Missing prod debug handler #11053

nicolas-grekas opened this issue Jun 4, 2014 · 6 comments
Labels

Comments

@nicolas-grekas
Copy link
Member

Follup of this comment:

Something is missing since a long time in the configuration of the prod environment for error handling: the ErrorsLoggersListener does a ErrorHandler::setLogger(), but ErrorHandler::register() is never called, so no logging can ever happen, except the one done by the native PHP handler.

This led me to two points:

  • I think we should always call ErrorHandler::register(), and use set_error_handler()'s second argument to catch only what we want to catch (thus no perf impact in prod).
  • Does Symfony have recommended settings for log_errors and error_log ini settings? Because IMHO it could be a good idea to put native php logs in app/logs/, if the settings are not configured.
@b-durand
Copy link

Is this related to this ad or not?

@nicolas-grekas
Copy link
Member Author

Sort of yes: by default, fatal errors are not handled in prod env I think.

@b-durand
Copy link

@nicolas-grekas it's never worked for me. So I do not understand the announcement on the blog.

@Koc
Copy link
Contributor
Koc commented Jun 16, 2014

looks like duplicate of older issue #8281

@nicolas-grekas
Copy link
Member Author

You're right, thanks for the hint @Koc

@fabpot
Copy link
Member
fabpot commented Sep 24, 2014

Some more discussions about this topic in #6474

@fabpot fabpot closed this as completed Oct 3, 2014
fabpot added a commit that referenced this issue Oct 3, 2014
…-grekas)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] enable ErrorHandler in prod

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11053, #8281
| License       | MIT
| Doc PR        | -

-  a new debug.error_handler service is the registered PHP error handler, with ErrorHandler::register() as factory
- ErrorHandler::register() is patched so that it checks if the currently registered error handler is an instance of ErrorHandler - in which case it returns this instance and don't create a new one.
- DebugHandlersListener now listen to ConsoleEvents and re-injects fatal errors within the $app->renderException code path
- DebugHandlersListener also has a new $scream parameter to control is silenced errors are logged or not

Commits
-------

fac3cc4 [FrameworkBundle] register ErrorHandler at boot time
4acf5d3 [Debug] make screaming configurable
4d0ab7d [FrameworkBundle] enable ErrorHandler in prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
0