feat: proper logging to dedicated audit channel
This commit is contained in:
@@ -2,7 +2,7 @@ monolog:
|
||||
channels:
|
||||
- deprecation
|
||||
- bpn
|
||||
- myep
|
||||
- audit
|
||||
|
||||
handlers:
|
||||
main:
|
||||
@@ -11,7 +11,7 @@ monolog:
|
||||
handler: exceptions
|
||||
excluded_http_codes: [404, 405]
|
||||
buffer_size: 50
|
||||
channels: ["!bpn", "!myep"]
|
||||
channels: ["!bpn", "!audit"]
|
||||
exceptions:
|
||||
type: rotating_file
|
||||
path: "%kernel.logs_dir%/framework.%kernel.environment%.log"
|
||||
@@ -23,14 +23,14 @@ monolog:
|
||||
path: '%kernel.logs_dir%/bpn.%kernel.environment%.log'
|
||||
max_files: 5
|
||||
level: info
|
||||
myep:
|
||||
channels: [ "myep" ]
|
||||
audit:
|
||||
channels: [ "audit" ]
|
||||
type: rotating_file
|
||||
path: '%kernel.logs_dir%/myep.%kernel.environment%.log'
|
||||
path: '%kernel.logs_dir%/audit.%kernel.environment%.log'
|
||||
max_files: 5
|
||||
level: info
|
||||
database:
|
||||
channels: ["myep"]
|
||||
channels: ["audit"]
|
||||
type: service
|
||||
id: App\Logging\DatabaseHandler
|
||||
console:
|
||||
@@ -38,6 +38,18 @@ monolog:
|
||||
process_psr_3_messages: false
|
||||
channels: ["!event", "!bpn", "!doctrine", "!console"]
|
||||
|
||||
when@dev:
|
||||
monolog:
|
||||
handlers:
|
||||
# Single catch-all file so everything is visible in one place during
|
||||
# development. The handlers above are error-level or channel-bound,
|
||||
# which makes ordinary app output invisible locally.
|
||||
dev:
|
||||
type: stream
|
||||
path: '%kernel.logs_dir%/%kernel.environment%.log'
|
||||
level: debug
|
||||
channels: ["!event", "!doctrine"]
|
||||
|
||||
when@test:
|
||||
monolog:
|
||||
handlers:
|
||||
@@ -61,7 +73,7 @@ when@prod:
|
||||
handler: exceptions
|
||||
excluded_http_codes: [404, 405]
|
||||
buffer_size: 50
|
||||
channels: ["!bpn", "!myep"]
|
||||
channels: ["!bpn", "!audit"]
|
||||
exceptions:
|
||||
type: rotating_file
|
||||
path: "%kernel.logs_dir%/framework.%kernel.environment%.log"
|
||||
@@ -73,17 +85,17 @@ when@prod:
|
||||
path: '%kernel.logs_dir%/bpn.%kernel.environment%.log'
|
||||
max_files: 5
|
||||
level: info
|
||||
myep:
|
||||
channels: [ "myep" ]
|
||||
audit:
|
||||
channels: [ "audit" ]
|
||||
type: rotating_file
|
||||
path: '%kernel.logs_dir%/myep.%kernel.environment%.log'
|
||||
path: '%kernel.logs_dir%/audit.%kernel.environment%.log'
|
||||
max_files: 5
|
||||
level: info
|
||||
database:
|
||||
channels: ["myep"]
|
||||
channels: ["audit"]
|
||||
type: service
|
||||
id: App\Logging\DatabaseHandler
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
||||
channels: ["!event", "!doctrine", "!bpn", "!myep"]
|
||||
channels: ["!event", "!doctrine", "!bpn", "!audit"]
|
||||
|
||||
@@ -43,7 +43,10 @@ services:
|
||||
autoconfigure: true
|
||||
bind:
|
||||
$tempDir: '%kernel.project_dir%/temp'
|
||||
$logger: '@monolog.logger.myep'
|
||||
# Application audit channel, not a MyE&P one: this is what feeds the
|
||||
# log table via App\Logging\DatabaseHandler. Unbinding a service from
|
||||
# it drops its records from that table.
|
||||
$logger: '@monolog.logger.audit'
|
||||
$houses: '%houses%'
|
||||
$xmlExport: '@xml_export.storage'
|
||||
$xmlDump: '@xml_dump.storage'
|
||||
|
||||
Reference in New Issue
Block a user