Verified Commit 6ec9f327 authored by Bastien Durel's avatar Bastien Durel
Browse files

add README with instructions

parent 5d94808b
Loading
Loading
Loading
Loading

README.md

0 → 100644
+46 −0
Original line number Diff line number Diff line
# data/dbal_log_time

This module provides a class to extends DBAL logging with execution time

## Install

```
composer require data/dbal_log_time
```

## Activation

In `services.yaml`, add :

```
services:
    doctrine.dbal.logger:
        class: 'Data\DbalLogTime\DbalLogger'
        tags:
            - name: "monolog.logger"
              channel: "doctrine"
        arguments:
            - "@logger"
            - "@debug.stopwatch"
```

Then you can configure logging as usual, for example :

```
# config/packages/prod/monolog.yamlmonolog:
    handlers:
        db:
            channels: doctrine
            type:     stream
            level:    debug
            path:     '%kernel.logs_dir%/doctrine.log'
```

```
# config/packages/prod/doctrine.yaml
doctrine:
    dbal:
        connections:
            default:
                logging: true
```