Skip to content

Commit 587e6f7

Browse files
Benoit NgoNgob
authored andcommitted
Adding monolog bundle
1 parent 54fcf24 commit 587e6f7

File tree

6 files changed

+362
-2
lines changed

6 files changed

+362
-2
lines changed

apps/back/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"symfony/dotenv": "5.4.*",
2121
"symfony/flex": "^1.17|^2",
2222
"symfony/framework-bundle": "5.4.*",
23+
"symfony/monolog-bundle": "^3.8",
2324
"symfony/property-access": "5.4.*",
2425
"symfony/property-info": "5.4.*",
2526
"symfony/proxy-manager-bridge": "5.4.*",

apps/back/composer.lock

Lines changed: 268 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/back/config/bundles.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
88
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
99
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
10+
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
1011
];
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
services:
2+
monolog.formatter.json.stacktraces:
3+
class: Monolog\Formatter\JsonFormatter
4+
calls:
5+
- [includeStacktraces]
6+
monolog.formatter.line.stacktraces:
7+
class: Monolog\Formatter\LineFormatter
8+
calls:
9+
- [includeStacktraces]
10+
monolog.formatter.default:
11+
alias: monolog.formatter.line.stacktraces
12+
monolog:
13+
channels:
14+
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists
15+
16+
when@dev:
17+
monolog:
18+
handlers:
19+
main:
20+
type: stream
21+
path: "%kernel.logs_dir%/%kernel.environment%.log"
22+
level: debug
23+
channels: ["!event"]
24+
formatter: monolog.formatter.default
25+
# uncomment to get logging in your browser
26+
# you may have to allow bigger header sizes in your Web server configuration
27+
#firephp:
28+
# type: firephp
29+
# level: info
30+
#chromephp:
31+
# type: chromephp
32+
# level: info
33+
stdout:
34+
type: stream
35+
path: php://stdout
36+
level: debug
37+
channels: ['!event']
38+
formatter: monolog.formatter.default
39+
console:
40+
type: console
41+
process_psr_3_messages: false
42+
channels: ["!event", "!doctrine", "!console"]
43+
44+
when@test:
45+
monolog:
46+
handlers:
47+
main:
48+
type: fingers_crossed
49+
action_level: error
50+
handler: nested
51+
excluded_http_codes: [404, 405]
52+
channels: ["!event"]
53+
nested:
54+
type: stream
55+
path: "%kernel.logs_dir%/%kernel.environment%.log"
56+
level: debug
57+
58+
when@prod:
59+
monolog:
60+
handlers:
61+
main:
62+
type: fingers_crossed
63+
action_level: error
64+
handler: nested
65+
excluded_http_codes: [404, 405]
66+
buffer_size: 100 # How many messages should be saved? Prevent memory leaks
67+
nested:
68+
type: stream
69+
path: "php://stderr"
70+
level: debug
71+
formatter: monolog.formatter.default
72+
console:
73+
type: console
74+
process_psr_3_messages: false
75+
channels: ["!event", "!doctrine"]
76+
deprecation:
77+
type: stream
78+
channels: [deprecation]
79+
path: php://stderr

apps/back/config/packages/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ security:
2020
lazy: true
2121
provider: app_user_provider
2222
custom_authenticators:
23-
- 'App\Authenticator\Saml2Authenticator'
23+
- 'App\Authenticator\Saml2Authenticator'
2424

2525
# activate differents ways to authenticate
2626
# https://symfony.com/doc/current/security.html#the-firewall

0 commit comments

Comments
 (0)