Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler #30345

Merged
merged 1 commit into from Feb 23, 2019

Conversation

Projects
None yet
4 participants
@lyrixx
Copy link
Member

commented Feb 22, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR

see also symfony/monolog-bundle#297

from that:
image

to that:
image

with some configuration:

diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml
index b1998da..66ae2db 100644
--- a/config/packages/dev/monolog.yaml
+++ b/config/packages/dev/monolog.yaml
@@ -17,3 +17,6 @@ monolog:
             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

lyrixx added a commit to symfony/monolog-bundle that referenced this pull request Feb 22, 2019

@nicolas-grekas nicolas-grekas added this to the next milestone Feb 23, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Feb 23, 2019

The configuration you have in the description should be the default one, right? Is it possible to make it the default in the bundle? Or at least, add this snippet in the recipe?

@fabpot

fabpot approved these changes Feb 23, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Feb 23, 2019

Thank you @lyrixx.

@fabpot fabpot merged commit 5e494db into symfony:master Feb 23, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Feb 23, 2019

feature #30345 [Monolog] Added a way to configure the ConsoleFormatte…
…r from the ConsoleHandler (lyrixx)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        |

see also symfony/monolog-bundle#297

from that:
![image](https://user-images.githubusercontent.com/408368/53246085-f63ed380-36af-11e9-9bff-2e42f8af141c.png)

to that:
![image](https://user-images.githubusercontent.com/408368/53246115-0787e000-36b0-11e9-93ef-e47ed058adbf.png)

with some configuration:

```yaml
diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml
index b1998da..66ae2db 100644
--- a/config/packages/dev/monolog.yaml
+++ b/config/packages/dev/monolog.yaml
@@ -17,3 +17,6 @@ monolog:
             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
```

Commits
-------

5e494db [Monolog] Added a way to configure the ConsoleFormatter from the ConsoleHandler

@lyrixx lyrixx deleted the lyrixx:monolog-console-format branch Feb 23, 2019

@lyrixx

This comment has been minimized.

Copy link
Member Author

commented Feb 24, 2019

The configuration you have in the description should be the default one, right? Is it possible to make it the default in the bundle? Or at least, add this snippet in the recipe?

It's really a matter of taste. But I could send a PR with commented configuration. WDYT ?

lyrixx added a commit to symfony/monolog-bundle that referenced this pull request Mar 12, 2019

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
@lyrixx

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

Here we go: symfony/recipes#552

@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019

@fabpot fabpot referenced this pull request May 9, 2019

Merged

Release v4.3.0-BETA1 #31435

@lyrixx lyrixx referenced this pull request May 16, 2019

Open

Add options to monolog console handler and formatter #23929

1 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.