-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
I'm trying to re-set formatters of the Logger but it seems it not changed on loop formatters, and when changin on loop by addWriter, it got hang. @acelaya do you have an idea to re-set writers's formatter/filter so it can switch? hint : SplPriorityQueue... |
I've been taking a look at a project where I used a logger. 'writers' => [
[
'name' => 'stream',
'options' => [
'stream' => 'php://output',
'filters' => [
'priority' => [
'name' => 'priority',
'options' => [
'priority' => \Zend\Log\Logger::DEBUG,
],
],
],
'formatter' => [
'name' => 'simple',
'options' => [
'format' => '%timestamp% %priorityName% (%priority%): %message%'.PHP_EOL,
],
],
],
],
], Try with this 'writers' => [
[
'name' => 'stream',
'priority' => \Zend\Log\Logger::DEBUG,
'options' => [
'stream' => 'php://output',
'formatter' => [
'name' => 'simple',
'options' => [
'format' => '%timestamp% %priorityName% (%priority%): %message%'.PHP_EOL,
],
],
],
],
], |
Ok, I will try if that possible be change-able on form posted change priority/formatter. Thank you. |
I'm thinking about not inject controller with Logger instance, but use 'log' config as controller property, and create new Logger on the fly when form submitted, so Logger instance can be created by : $this->loggerConfig['writers'][0]['options']['formatter']['name'] = $data['logformat'];
$logger = new Logger($this->loggerConfig); I will do it.. |
it's done, ready for review ;) |
@acelaya any review for this ? merge-able ? |
Sorry, I won't be able to test it until tomorrow evening, sorry. However Alejandro Celaya Alastrué
|
It's ok for tomorrow ;). to reproduce it, there is updated Warm Regards, Abdul Malik Ikhsan 2015-02-23 17:23 GMT+07:00 Alejandro Celaya notifications@github.com:
|
It properly works. It can be merged! |
Forward port #113 * add/learn-zf2-log: (22 commits) changelog 113 add IndexControllerFactory test place init() test in testHasElement() add LogForm test more test style move controller test under test/PHPUnit/Controller folder PHP_EOL php 5.4 && 5.5 fixes codeception test of logger page done, ready for review log generated use logconfig as controller property so logger need to be instantiate on the fly inject controller with logger and form cs prepare add form and factory adding Form cs short array syntax short array syntax basic structure of module ...
@acelaya merged. Thanks ;) |
Fixes #106