it / swift-mailer-logger-bundle
A simple Monolog and Database logger for SwiftMailer emails
Installs: 113
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.8
- doctrine/doctrine-bundle: *
- symfony/framework-bundle: ~2.8
- symfony/monolog-bundle: 2.*
- twig/twig: *
This package is not auto-updated.
Last update: 2025-04-26 23:09:59 UTC
README
Symfony2 Bundle for logging all emails sent with SwiftMailer.
Installation
Install with composer :
composer require it/swift-mailer-logger-bundle
Enable the bundle in your project
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new IT\SwiftMailerLoggerBundle\ITSwiftMailerLoggerBundle(), // ... ); }
Config
Add the following line to your config.yml
:
# 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 :
php app/console doctrine:schema:update --dump-sql --force