Logging full stack trace with Monolog

Actually since version 1.12.0 it is possible to include stacktrace at your log file: there is new method of LineFormatter called includeStacktraces.

To use this, you need to overwrite default behaviour of monolog formatter:

config.yml

monolog:
    handlers:
        main:
            formatter: your.monolog.service.id
            (rest of config is as usual)

services.yml

services:
    your.monolog.service.id:
        class: Monolog\Formatter\LineFormatter
        calls:
            - [includeStacktraces]

Check github for more info:
Pull request

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)