From cd876bd889963d4be19cdf5e60b0e93a7852530b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 6 Sep 2023 12:14:53 +0200 Subject: [PATCH] Upgrade recipes: symfony/monolog-bundle --- config/packages/dev/monolog.yaml | 21 --------- config/packages/monolog.yaml | 62 ++++++++++++++++++++++++++ config/packages/prod/deprecations.yaml | 8 ---- config/packages/prod/monolog.yaml | 1 + config/packages/test/monolog.yaml | 12 ----- symfony.lock | 13 +++--- 6 files changed, 68 insertions(+), 49 deletions(-) delete mode 100644 config/packages/dev/monolog.yaml create mode 100644 config/packages/monolog.yaml delete mode 100644 config/packages/prod/deprecations.yaml delete mode 100644 config/packages/test/monolog.yaml diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml deleted file mode 100644 index 423fc10..0000000 --- a/config/packages/dev/monolog.yaml +++ /dev/null @@ -1,21 +0,0 @@ -monolog: - handlers: - main: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug - channels: ["!event"] - # uncomment to get logging in your browser - # you may have to allow bigger header sizes in your Web server configuration - #firephp: - # type: firephp - # level: info - #chromephp: - # type: chromephp - # level: info - console: - type: console - process_psr_3_messages: false - channels: ['!event', '!doctrine', '!console'] - bubble: false - diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml new file mode 100644 index 0000000..6ba3347 --- /dev/null +++ b/config/packages/monolog.yaml @@ -0,0 +1,62 @@ +monolog: + channels: + - deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists + +when@dev: + monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] + # uncomment to get logging in your browser + # you may have to allow bigger header sizes in your Web server configuration + #firephp: + # type: firephp + # level: info + #chromephp: + # type: chromephp + # level: info + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine", "!console"] + +when@test: + monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + channels: ["!event"] + nested: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + +# those comes from the symfony recipe. But this is overriden by the ./prod/monolog.yaml config +# when@prod: +# monolog: +# handlers: +# main: +# type: fingers_crossed +# action_level: error +# handler: nested +# excluded_http_codes: [404, 405] +# buffer_size: 50 # How many messages should be saved? Prevent memory leaks +# nested: +# type: stream +# path: php://stderr +# level: debug +# formatter: monolog.formatter.json +# console: +# type: console +# process_psr_3_messages: false +# channels: ["!event", "!doctrine"] +# deprecation: +# type: stream +# channels: [deprecation] +# path: php://stderr diff --git a/config/packages/prod/deprecations.yaml b/config/packages/prod/deprecations.yaml deleted file mode 100644 index 920a061..0000000 --- a/config/packages/prod/deprecations.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists -#monolog: -# channels: [deprecation] -# handlers: -# deprecation: -# type: stream -# channels: [deprecation] -# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log" diff --git a/config/packages/prod/monolog.yaml b/config/packages/prod/monolog.yaml index e3a255d..e4a85e4 100644 --- a/config/packages/prod/monolog.yaml +++ b/config/packages/prod/monolog.yaml @@ -25,6 +25,7 @@ monolog: id: monolog.gelf_handler level: info channels: ['!event', '!php'] + excluded_http_codes: [404, 405] console: type: console diff --git a/config/packages/test/monolog.yaml b/config/packages/test/monolog.yaml deleted file mode 100644 index fc40641..0000000 --- a/config/packages/test/monolog.yaml +++ /dev/null @@ -1,12 +0,0 @@ -monolog: - handlers: - main: - type: fingers_crossed - action_level: error - handler: nested - excluded_http_codes: [404, 405] - channels: ["!event"] - nested: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug diff --git a/symfony.lock b/symfony.lock index 4c5890c..fb6078c 100644 --- a/symfony.lock +++ b/symfony.lock @@ -604,18 +604,15 @@ "version": "v5.1.3" }, "symfony/monolog-bundle": { - "version": "3.3", + "version": "3.8", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "d7249f7d560f6736115eee1851d02a65826f0a56" + "branch": "main", + "version": "3.7", + "ref": "213676c4ec929f046dfde5ea8e97625b81bc0578" }, "files": [ - "config/packages/dev/monolog.yaml", - "config/packages/prod/deprecations.yaml", - "config/packages/prod/monolog.yaml", - "config/packages/test/monolog.yaml" + "config/packages/monolog.yaml" ] }, "symfony/options-resolver": {