Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 005aefb

Browse filesBrowse files
committed
feature #297 Expose configuration for the ConsoleHandler (lyrixx)
This PR was merged into the 3.x-dev branch. Discussion ---------- Expose configuration for the ConsoleHandler Like that we will be able to use this configuration (for example): ```yaml console: type: console process_psr_3_messages: false channels: ["!event", "!doctrine", "!console"] console_formater_options: format: "%%datetime%% %%start_tag%%%%level_name%%%%end_tag%% <comment>[%%channel%%]</> %%message%%%%context%%\n" multiline: false ``` see also symfony/symfony#30345 Commits ------- cc9abf6 Expose configuration for the ConsoleHandler
2 parents 523768f + cc9abf6 commit 005aefb
Copy full SHA for 005aefb

File tree

Expand file treeCollapse file tree

2 files changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-0
lines changed

‎DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: DependencyInjection/Configuration.php
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* - [verbosity_levels]: level => verbosity configuration
3737
* - [level]: level name or int value, defaults to DEBUG
3838
* - [bubble]: bool, defaults to true
39+
* - [console_formater_options]: array
3940
*
4041
* - firephp:
4142
* - [level]: level name or int value, defaults to DEBUG
@@ -571,6 +572,16 @@ public function getConfigTreeBuilder()
571572
->then(function ($v) { return array_filter(array_map('trim', $v)); })
572573
->end()
573574
->prototype('scalar')->end()
575+
->end()
576+
// console
577+
->variableNode('console_formater_options')
578+
->defaultValue([])
579+
->validate()
580+
->ifTrue(function ($v) {
581+
return !is_array($v);
582+
})
583+
->thenInvalid('console_formater_options must an array.')
584+
->end()
574585
->end()
575586
->arrayNode('verbosity_levels') // console
576587
->beforeNormalization()

‎DependencyInjection/MonologExtension.php

Copy file name to clipboardExpand all lines: DependencyInjection/MonologExtension.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
176176
null,
177177
$handler['bubble'],
178178
isset($handler['verbosity_levels']) ? $handler['verbosity_levels'] : array(),
179+
$handler['console_formater_options']
179180
));
180181
$definition->addTag('kernel.event_subscriber');
181182
break;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.