mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
NEW Separate core error logging from standard LoggerInterface
This commit is contained in:
parent
a8853504b4
commit
1cb23178ec
@ -1,21 +1,34 @@
|
||||
---
|
||||
Name: logging
|
||||
---
|
||||
# Logging is built up of a chain containing:
|
||||
# Core error logging is built up of a chain containing:
|
||||
# - A top level \ErrorHandler which registers the error service
|
||||
# - A \Logger which acts as the error service
|
||||
# - A \HandlerInterface which handles errors for the logger
|
||||
# - One or more \FormatterInterface which format errors for the handler
|
||||
#
|
||||
# Logging for use outside of core error handling also uses the same implementations,
|
||||
# but is available without the HandlerInterfaces attached
|
||||
SilverStripe\Core\Injector\Injector:
|
||||
SilverStripe\Logging\ErrorHandler:
|
||||
class: SilverStripe\Logging\MonologErrorHandler
|
||||
properties:
|
||||
Logger: '%$Psr\Log\LoggerInterface'
|
||||
calls:
|
||||
pushDefaultLogger: [ pushHandler, [ '%$Psr\Log\LoggerInterface' ] ]
|
||||
pushErrorHandler: [ pushHandler, [ '%$Psr\Log\LoggerInterface.errorhandler' ] ]
|
||||
|
||||
# Default implementation for use as a standard logger. Up to developers to attach their own
|
||||
# handlers
|
||||
Psr\Log\LoggerInterface:
|
||||
type: singleton
|
||||
class: Monolog\Logger
|
||||
constructor:
|
||||
- "error-log"
|
||||
# Core error handling
|
||||
Psr\Log\LoggerInterface.errorhandler:
|
||||
type: singleton
|
||||
class: Monolog\Logger
|
||||
constructor:
|
||||
- "error-handler"
|
||||
calls:
|
||||
pushDisplayErrorHandler: [ pushHandler, [ '%$Monolog\Handler\HandlerInterface' ] ]
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user