<commit_before># SwiftMailerLoggerBundle

Symfony2 Bundle for logging all emails sent with the SwiftMailer. 

## Installation

Install with composer :
```bash
composer require it/swift-mailer-logger-bundle
```

### Enable the bundle in your project

```php
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new IT\SwiftMailerLoggerBundle\ITSwiftMailerLoggerBundle(),
        // ...
    );
}
```

## Config

Add the following line to your `config.yml` :
```yaml
# app/config/config.yml

it_swift_mailer_logger:
    level:              debug          # Default to "info"
    type:               rotating_file  # Default to "rotating_file"
    path:               ~              # Default to "%kernel.logs_dir%/mailer.%kernel.environment%.log"
    max_files:          15             # Défault to 10
#    enable_db_logger:  false          # Default to false. Set it to true to enable the database logger
```

## Usage

A log file will automatically be created et filled when you send emails.
Turn ON the database logger to log all emails sent into your database.

**Warning :**
If you want to use the database logger, don't forget to update your database with the following command :
```bash
php app/console doctrine:schema:update --dump-sql --force <commit_msg>typo / grammar in README.md<commit_after># SwiftMailerLoggerBundle

Symfony2 Bundle for logging all emails sent with SwiftMailer. 

## Installation

Install with composer :
```bash
composer require it/swift-mailer-logger-bundle
```

### Enable the bundle in your project

```php
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new IT\SwiftMailerLoggerBundle\ITSwiftMailerLoggerBundle(),
        // ...
    );
}
```

## Config

Add the following line to your `config.yml` :
```yaml
# app/config/config.yml

it_swift_mailer_logger:
    level:              debug          # Default to "info"
    type:               rotating_file  # Default to "rotating_file"
    path:               ~              # Default to "%kernel.logs_dir%/mailer.%kernel.environment%.log"
    max_files:          15             # Défault to 10
#    enable_db_logger:  false          # Default to false. Set it to true to enable the database logger
```

## Usage

A log file will automatically be created and filled when emails are sent.
Turn ON the database logger to log all emails sent into your database.

**Warning :**
If you want to use the database logger, don't forget to update your database with the following command :
```bash
php app/console doctrine:schema:update --dump-sql --force 
{'fraction_non_alphanumeric': 0.09426073736221968, 'fraction_numerical': 0.003800836183960471, 'mean_word_length': 2.6657381615598887, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3561349', 'n_tokens_mistral': 776, 'n_tokens_neox': 724, 'n_words': 264}