简体   繁体   中英

Using Monolog and ReactPHP

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?

这只是一个猜测,但是您的错误通常是通过PHP的set_exception_handler()记录的,而ReactPHP会在其请求处理程序中捕获未捕获的异常,以确保服务器正常运行并不会因每个未捕获的异常而死亡。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM