itk-dev / monolog-db-bundle
Monolog handler for logging to a database table
Installs: 34
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.0.0
- doctrine/orm: ^2.5
- symfony/monolog-bundle: ^3.1.0
- symfony/symfony: ^3.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.10
- phpunit/phpunit: ^6.5
- squizlabs/php_codesniffer: ^3.2
This package is auto-updated.
Last update: 2024-12-21 18:08:24 UTC
README
Write log entries to a database.
Installation:
composer require itk-dev/monolog-db-bundle "^1.0"
Add bundle in your AppKernel.php
:
public function registerBundles() { $bundles = [ …, new ItkDev\MonologDbBundle\ItkDevMonologDbBundle(), … ]; … }
Configuration:
monolog: channels: ['db'] handlers: db: channels: ['db'] type: service id: itk_dev.monolog.db_handler
Usage:
… $logger = $container->get('monolog.logger.db'); $logger->info($message); …
Entries logged have a type
property which can be used for filtering
entries. The type can be set by adding the type
key to the logging
context:
$logger->info($message, [ 'type' => 'my_log_entry', ]);
Command:
bin/console itk-dev:monolog-db:show --help