When an error occurs during a normal http request, Symfony2 logs everything (depending on your logging level) and you can see it in dev.log or app.log.
But when you get an error during the execution of a custom command, it doesn't log anything. It just shows a red message in standard output, that doesn't even have a backtrace.
What can I do to have all errors logged, like in the first case?