Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
21.02k stars 1.9k forks source link

ErrorHandler::register not working as expected #1915

Open kaihendry opened 1 month ago

kaihendry commented 1 month ago

Monolog version 3.7

https://gist.github.com/kaihendry/6ad32ed135e3d679e6dd896365b252cb

The error handler is not working as expected, it shows:

  {"level":"info","ts":1726946030.4808884,"msg":"capture me monolog","syslog_level":"notice"}
stof commented 4 weeks ago

what do you mean by "it is not working as expected" ?

kaihendry commented 4 weeks ago

I expected monolog to hook into error_log

stof commented 4 weeks ago

PHP's error_log function does not report its messages to the PHP error handler system. It directly sends it to the PHP system logger, which is not hookable in userland.