mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
4c772c80c3
API: Add HTTPOutputHandler::setCLIFormatter Fixes https://github.com/silverstripe/silverstripe-framework/issues/6835 This provides detailed errors (but not warnings or notices) in CLI calls on live environments. It does this by adding a 2nd argument to our output handler, CliFormatter. This formatter will be used when Director::is_cli() is true.
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
---
|
|
Name: logging
|
|
---
|
|
SilverStripe\Core\Injector\Injector:
|
|
ErrorHandler:
|
|
class: SilverStripe\Logging\MonologErrorHandler
|
|
properties:
|
|
Logger: %$Psr\Log\LoggerInterface
|
|
Psr\Log\LoggerInterface:
|
|
type: singleton
|
|
class: Monolog\Logger
|
|
constructor:
|
|
- "error-log"
|
|
calls:
|
|
DisplayErrorHandler: [ pushHandler, [ %$DisplayErrorHandler ] ]
|
|
|
|
---
|
|
Name: dev-logging
|
|
Only:
|
|
environment: dev
|
|
---
|
|
SilverStripe\Core\Injector\Injector:
|
|
DisplayErrorHandler:
|
|
class: SilverStripe\Logging\HTTPOutputHandler
|
|
constructor:
|
|
- "notice"
|
|
properties:
|
|
Formatter: %$SilverStripe\Logging\DetailedErrorFormatter
|
|
---
|
|
Name: live-logging
|
|
Except:
|
|
environment: dev
|
|
---
|
|
SilverStripe\Core\Injector\Injector:
|
|
DisplayErrorHandler:
|
|
class: SilverStripe\Logging\HTTPOutputHandler
|
|
constructor:
|
|
- "error"
|
|
properties:
|
|
Formatter: %$SilverStripe\Logging\DebugViewFriendlyErrorFormatter
|
|
CLIFormatter: %$SilverStripe\Logging\DetailedErrorFormatter
|
|
SilverStripe\Logging\DebugViewFriendlyErrorFormatter:
|
|
class: SilverStripe\Logging\DebugViewFriendlyErrorFormatter
|
|
properties:
|
|
Title: "There has been an error"
|
|
Body: "The website server has not been able to respond to your request"
|