-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Configuring symfony/debug error handler to only log on STDERR #20347
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
Labels
Comments
You can use monolog to help you with that. You just need to register one of the monolog loggers to the debug ErrorHandler class. |
Could you give me a small code snippet? |
I tried it like this $logger = new Logger('Errors');
$logger->pushHandler(new StreamHandler(STDERR));
$errorHandler = new ErrorHandler;
$errorHandler->setDefaultLogger($logger);
ErrorHandler::register($errorHandler); But when an error occurs I get an infinite recursion error:
Any help is appreciated. |
Can you try again with latest release? |
Fixed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to do this? Using the error handler in a CLI app that talks an IPC protocol over STDIN/STDOUT. Printing a stack trace to STDOUT is a violation of the protocol of course, and there is no reason to do it as it can just print the stack trace to STDERR.
The text was updated successfully, but these errors were encountered: