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

WebProcessor in command line #36

Closed maxailloud closed 13 years ago

maxailloud commented 13 years ago

I don't know if it's a bug or not so i'll submit it anyway.

I just configured my application to log in a file when in 'dev' environment with a WebProcessor associated. It works fine in a navigator, but when i launched a command in the command line i get this error: _Notice: Undefined index: REQUESTURI in /home/mailloud/workspace/referentiel/vendor/monolog/src/Monolog/Processor/WebProcessor.php line 46

It's normal that 'REQUEST_URI' doesn't exist while w're not in a http process, and so no uri.

I think when call in command line this kind of processor should not work, and the fact that the command is launched in 'dev' mode should not change that.

With the option 'no-debug' the command works without problem bu at this time no log, not wanted if log are configured.

Seldaek commented 13 years ago

I don't think the WebProcessor is too useful in dev environment, but it still shouldn't crash in CLI, so it's fixed.