Repository: symfony/monolog-bundle (php)

Issue:
use_locking argument ignored for rotating_file handler
When the `use_locking` argument was implemented it was only added to the `stream` handler type, but the `rotating_file` extends it and should also have that argument.

See also: https://github.com/symfony/monolog-bundle/commit/00ed2f3c087e74b462f188b228ff1d428c4ed65e

Pull request:
Use "use_locking" option with rotating file handler as well
Fixes #382 .

Patch:
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index a094fe7..fdd74e4 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -63,6 +63,7 @@ use Monolog\Logger;
  *   - [level]: level name or int value, defaults to DEBUG
  *   - [bubble]: bool, defaults to true
  *   - [file_permission]: string|null, defaults to null
+ *   - [use_locking]: bool, defaults to false
  *   - [filename_format]: string, defaults to '{filename}-{date}'
  *   - [date_format]: string, defaults to 'Y-m-d'
  *
@@ -397,7 +398,7 @@ class Configuration implements ConfigurationInterface
                                     })
                                 ->end()
                             ->end()
-                            ->booleanNode('use_locking')->defaultFalse()->end() // stream
+                            ->booleanNode('use_locking')->defaultFalse()->end() // stream and rotating
                             ->scalarNode('filename_format')->defaultValue('{filename}-{date}')->end() //rotating
                             ->scalarNode('date_format')->defaultValue('Y-m-d')->end() //rotating
                             ->scalarNode('ident')->defaultFalse()->end() // syslog and syslogudp
diff --git a/DependencyInjection/MonologExtension.php b/DependencyInjection/MonologExtension.php
index 1a7c312..0554298 100644
--- a/DependencyInjection/MonologExtension.php
+++ b/DependencyInjection/MonologExtension.php
@@ -384,6 +384,7 @@ class MonologExtension extends Extension
                 $handler['level'],
                 $handler['bubble'],
                 $handler['file_permission'],
+                $handler['use_locking'],
             ]);
             $definition->addMethodCall('setFilenameFormat', [
                 $handler['filename_format'],


Test patch:
diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php
index eddc259..55667b3 100644
--- a/Tests/DependencyInjection/ConfigurationTest.php
+++ b/Tests/DependencyInjection/ConfigurationTest.php
@@ -334,7 +334,7 @@ class ConfigurationTest extends TestCase
                         'use_locking' => false,
                     ],
                     'bar' => [
-                        'type' => 'stream',
+                        'type' => 'rotating_file',
                         'path' => '/bar',
                         'use_locking' => true,
                     ]
diff --git a/Tests/DependencyInjection/FixtureMonologExtensionTest.php b/Tests/DependencyInjection/FixtureMonologExtensionTest.php
index 310a47c..5dada92 100644
--- a/Tests/DependencyInjection/FixtureMonologExtensionTest.php
+++ b/Tests/DependencyInjection/FixtureMonologExtensionTest.php
@@ -119,7 +119,7 @@ abstract class FixtureMonologExtensionTest extends DependencyInjectionTest
 
         $handler = $container->getDefinition('monolog.handler.first');
         $this->assertDICDefinitionClass($handler, 'Monolog\Handler\RotatingFileHandler');
-        $this->assertDICConstructorArguments($handler, ['/tmp/monolog.log', 0, \Monolog\Logger::ERROR, true, null]);
+        $this->assertDICConstructorArguments($handler, ['/tmp/monolog.log', 0, \Monolog\Logger::ERROR, true, null, false]);
 
         $handler = $container->getDefinition('monolog.handler.last');
         $this->assertDICDefinitionClass($handler, 'Monolog\Handler\StreamHandler');