parameters:
    logger_database.class: LifeStyle\Tools\DbLogBundle\Logger\DatabaseHandler
    logger_database.storeTime: 432000
    logger_database.purgeProbability: 0.25
    logger_database.level: debug
    logger_database.bubble: true

services:
    monolog.processor.request:
        class: LifeStyle\Tools\DbLogBundle\Processor\RequestProcessor
        arguments: ["@session", '@life_style_tools_db_log.processor.process_details']
        tags:
            - { name: monolog.processor, method: processRecord }
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest}
    lifestyle_monolog_db:
        class: "%logger_database.class%"
        arguments: ["%logger_database.level%", "%logger_database.bubble%"]
        calls:
          - ["setContainer", ["@service_container"]]
    lifestyle_monolog_db_rotate:
        class: LifeStyle\Tools\DbLogBundle\EventListener\LogrotateListener
        arguments: ["@doctrine.orm.readwrite_entity_manager", "%logger_database.storeTime%", "%logger_database.purgeProbability%"]
        tags:
            - { name: kernel.event_listener, event: kernel.controller, method: onController }
    tools.backtrace_logger_listener:
        class: LifeStyle\Tools\DbLogBundle\EventListener\BacktraceLoggerListener
        tags:
            - {name: "monolog.logger", channel: "backtrace"}
            - {name: "kernel.event_listener", event: "kernel.exception", method: "onKernelException"}
        arguments:
            - "@logger"

    life_style_tools_db_log.processor.process_details:
        class: LifeStyle\Tools\DbLogBundle\Processor\ProcessDetails
        arguments: ['@security.token_storage']
        public: false