Skip to content

Commit 1e3a6a0

Browse files
committed
Use "use_locking" option with rotating fie handler as well
1 parent b9b322d commit 1e3a6a0

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
* - [level]: level name or int value, defaults to DEBUG
6464
* - [bubble]: bool, defaults to true
6565
* - [file_permission]: string|null, defaults to null
66+
* - [use_locking]: bool, defaults to false
6667
* - [filename_format]: string, defaults to '{filename}-{date}'
6768
* - [date_format]: string, defaults to 'Y-m-d'
6869
*
@@ -397,7 +398,7 @@ public function getConfigTreeBuilder()
397398
})
398399
->end()
399400
->end()
400-
->booleanNode('use_locking')->defaultFalse()->end() // stream
401+
->booleanNode('use_locking')->defaultFalse()->end() // stream and rotating
401402
->scalarNode('filename_format')->defaultValue('{filename}-{date}')->end() //rotating
402403
->scalarNode('date_format')->defaultValue('Y-m-d')->end() //rotating
403404
->scalarNode('ident')->defaultFalse()->end() // syslog and syslogudp

DependencyInjection/MonologExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
384384
$handler['level'],
385385
$handler['bubble'],
386386
$handler['file_permission'],
387+
$handler['use_locking'],
387388
]);
388389
$definition->addMethodCall('setFilenameFormat', [
389390
$handler['filename_format'],

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public function testWithUseLocking()
334334
'use_locking' => false,
335335
],
336336
'bar' => [
337-
'type' => 'stream',
337+
'type' => 'rotating_file',
338338
'path' => '/bar',
339339
'use_locking' => true,
340340
]

Tests/DependencyInjection/FixtureMonologExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function testLoadWithNewAndPriority()
119119

120120
$handler = $container->getDefinition('monolog.handler.first');
121121
$this->assertDICDefinitionClass($handler, 'Monolog\Handler\RotatingFileHandler');
122-
$this->assertDICConstructorArguments($handler, ['/tmp/monolog.log', 0, \Monolog\Logger::ERROR, true, null]);
122+
$this->assertDICConstructorArguments($handler, ['/tmp/monolog.log', 0, \Monolog\Logger::ERROR, true, null, false]);
123123

124124
$handler = $container->getDefinition('monolog.handler.last');
125125
$this->assertDICDefinitionClass($handler, 'Monolog\Handler\StreamHandler');

0 commit comments

Comments
 (0)