From 7c1698ed985c27eb8c80e89f1237a91d53368485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 1 Jun 2016 16:16:20 +0200 Subject: [PATCH] adding a logger for chill The logger log messages to channel "chill". The name of the service is `chill.main.logger` --- DependencyInjection/ChillMainExtension.php | 6 ++++++ Resources/config/services/logger.yml | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 Resources/config/services/logger.yml diff --git a/DependencyInjection/ChillMainExtension.php b/DependencyInjection/ChillMainExtension.php index b66425ec4..da01a164f 100644 --- a/DependencyInjection/ChillMainExtension.php +++ b/DependencyInjection/ChillMainExtension.php @@ -34,6 +34,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); + $loader->load('services/logger.yml'); } public function prepend(ContainerBuilder $container) @@ -82,5 +83,10 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface ) )); + + //add a channel to log app events + $container->prependExtensionConfig('monolog', array( + 'channels' => array('chill') + )); } } diff --git a/Resources/config/services/logger.yml b/Resources/config/services/logger.yml new file mode 100644 index 000000000..2da5a4a4c --- /dev/null +++ b/Resources/config/services/logger.yml @@ -0,0 +1,4 @@ +services: + chill.main.logger: + # a logger to log events from the app (deletion, remove, etc.) + alias: monolog.logger.chill