2

I'm trying to build my Symfony application on top of ReactPHP engine, and everything goes fine, but the logs.

I have my application configured with a regular file log under devel environment, and a simple syslog log with level=error under production. In both environments I have "debug" enabled, otherwise even without ReactPHP and using a simple Apache, I cannot see any error in syslog.

The problem comes when I use ReactPHP. Initializing the symfony kernel using devel environment, everything is logged BUT the exception. It seems that I'm doing something wrong because Monolog is not handling the exception and any error is being logged.

  • Do you know any part of the Symfony application initialization where all this handlers are enabled (and I should add it as well in the kernel initialization in my ReactPHP file)?
  • If not, then... Symfony should work the same way under ReactPHP, right? I mean, the kernel should always handle any error/exception and log it the way I configured in MonologBundle, and after that, throw the exception again, right?
Stephan Vierkant
  • 9,674
  • 8
  • 61
  • 97
mmoreram
  • 687
  • 5
  • 13

1 Answers1

0

This is just a guess, but maybe your error gets usually logged via PHP's set_exception_handler(), while ReactPHP will catch uncaught exceptions inside its request handler to ensure the server stays up and running and doesn't die for every uncaught exception.

kelunik
  • 6,750
  • 2
  • 41
  • 70
  • Yes, maybe, but where this `set_exception_handler()` is introduced in Symfony? – mmoreram Nov 16 '17 at 16:11
  • https://github.com/symfony/symfony/blob/44b2f97dcd2ba10857dd545e424ad4f48c9dbea1/src/Symfony/Component/Debug/ErrorHandler.php#L135 – kelunik Nov 16 '17 at 16:24