1

When running application with production settings and debug disabled monolog does not start. With enabled debugging it starts as usual. With development settings it starts regardless of debug options.

How to force monolog running on production settings with debugging disabled?

Dev and production configs are the same:

monolog:
    handlers:

    main:
        type:   stream
        path:   %kernel.logs_dir%/%kernel.environment%.log
        level:  debug
    firephp:
        type:   firephp
        level:  info
    custom:
        type:   service
        id:     monitoring.errbit
        level:  critical

On development settings monolog runs perfectly, on production it does not even start.

S3Mi
  • 491
  • 4
  • 10
  • 1
    How do you know it does not start? And why do you think that it should start? – hakre Nov 16 '12 at 14:50
  • First of all it didn't catch triggered errors. So I added die() to constructor of handler. I can see it runing when I set dev enviroment. – S3Mi Nov 16 '12 at 14:56
  • I assume you are missing to die then. And why do you think that it should start? – hakre Nov 16 '12 at 14:58
  • 1
    By default symfony use "crossfingers" handler in production so the log are showed only when a expection is throwed and then all the buffer of logs is dump. Check this if is your case. – Maks3w Nov 16 '12 at 17:31
  • @Maks3w as you can see in config there is no crossfingers handler. – S3Mi Nov 19 '12 at 10:02

1 Answers1

1

The default Symfony2 config contains different handlers for config_prod and config_dev. If you put this in config.yml, you should make sure you remove the monolog config block in config_prod.yml otherwise it will override the one from config.yml.

Aside from that, there really is no difference between prod and dev as far as monolog is concerned, unless you changed the bundle in the kernel to be only enabled in dev/test, but that's not the default.

Seldaek
  • 40,986
  • 9
  • 97
  • 77