Monolog vs workers vs supervisord

358 Views Asked by At

I can't get logs from the Symfony workers in my supervisord/runit log/stdout when starting my Docker container. Yes, I tried with supervisord and runit, but still does not work. If I have some exception in code I can see it regularly in stdout, but only that.

I'm afraid that something is with my Monolog configuration because if I add regular echo in my code I can see the output.

Monolog file is very simple:

handlers:
    main:
        type: stream
        path: "%kernel.logs_dir%/%kernel.environment%.log"
        level: debug
        channels: ["!event"]
    console:
        type: console
        process_psr_3_messages: false
        channels: ["!event", "!doctrine", "!console"]

I tried with path: 'php://stdout' or path: 'php://stderr' with/out changes in the php.ini files like: display_errors = On, error_log = /proc/self/fd/2, catch_workers_output = yes, but obeviously does not work. I can't find right combination.

Symfony workers are long-life process and I need some init processor to start it like supervisord or runit.

For runit, I tried some trick from this: https://git.nixaid.com/arno/show-runit, but as I mentioned above, regular echo works, and PSR Symfony logs not.

For both supervisord and runit, tried this: Symfony logs to stdout inside Docker container, but same - does not work.

Any hint?

0

There are 0 best solutions below