# Doctrine SQL File logging

**URL:** https://forum.shopware.com/t/doctrine-sql-file-logging/44529
**Category:** Programmierung
**Created:** [16. März 2017 um 08:57 UTC](https://forum.shopware.com/t/doctrine-sql-file-logging/44529 "2017-03-16T08:57:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![\_Geloschter\_Benutze7](https://avatars.discourse-cdn.com/v4/letter/_/cdc98d/32.png) [@\_Geloschter\_Benutze7](https://forum.shopware.com/u/_Geloschter_Benutze7)
#### Post date: [16. März 2017 um 08:57 UTC](https://forum.shopware.com/t/doctrine-sql-file-logging/44529/1 "2017-03-16T08:57:58Z")

</div>

Hallo,&nbsp;

ich würde gerne die SQL Query die mit Doctrine abgesetzt werden loggen.&nbsp;  
Das würde ich sehr gerne Global machen für das ganze System.&nbsp;

Meine Frage wäre jetzt wie kann ich diesen Zustand konfigurieren.&nbsp;  
Kann &nbsp;ich es wie im folgenden Beispiel machen oder muss ich dort noch etwas extra in die Config schreiben (Doctrine Logging habe ich in der Config nicht gefunden)?

&nbsp;

```
$config = new Doctrine\ORM\Configuration ();
$config->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());
$connectionParams = array(
        'dbname' => 'example',
        'user' => 'example',
        'password' => 'example',
        'host' => 'localhost',
        'driver' => 'pdo_mysql');
//make the connection through an Array of params ($connectionParams)
$em = EntityManager::create($connectionParams, $config);

```

Mit freundlichen Grüßen,&nbsp;  
Brian
