cms-niceties/_config/base-logs.yml_

61 lines
1.9 KiB
Plaintext
Raw Normal View History

2021-06-19 21:30:03 +02:00
---
2021-06-19 21:55:11 +02:00
Name: a2nt-cms-niceties-base-logs-dev
2021-06-19 21:30:03 +02:00
Only:
environment: dev
---
SilverStripe\Core\Injector\Injector:
Psr\Log\LoggerInterface.errorhandler:
calls:
pushMyDisplayErrorHandler: [pushHandler, ['%$DisplayErrorHandler']]
DisplayErrorHandler:
class: SilverStripe\Logging\HTTPOutputHandler
constructor:
- 'notice'
properties:
Formatter: '%$SilverStripe\Logging\DetailedErrorFormatter'
CLIFormatter: '%$SilverStripe\Logging\DetailedErrorFormatter'
---
2021-06-19 21:55:11 +02:00
Name: a2nt-cms-niceties-base-logs-live
2021-06-19 21:30:03 +02:00
Except:
environment: dev
---
SilverStripe\Core\Injector\Injector:
# Default logger implementation for general purpose use
Psr\Log\LoggerInterface:
calls:
# Save system logs to file
pushFileLogHandler: [pushHandler, ['%$LogFileHandler']]
# Core error handler for system use
Psr\Log\LoggerInterface.errorhandler:
calls:
# Save errors to file
pushFileLogHandler: [pushHandler, ['%$LogFileHandler']]
# Format and display errors in the browser/CLI
pushMyDisplayErrorHandler: [pushHandler, ['%$DisplayErrorHandler']]
# Custom handler to log to a file
LogFileHandler:
class: Monolog\Handler\StreamHandler
constructor:
- '../silverstripe.log'
- 'notice'
properties:
Formatter: '%$Monolog\Formatter\HtmlFormatter'
ContentType: text/html
# Handler for displaying errors in the browser or CLI
DisplayErrorHandler:
class: SilverStripe\Logging\HTTPOutputHandler
constructor:
- 'error'
properties:
Formatter: '%$SilverStripe\Logging\DebugViewFriendlyErrorFormatter'
# Configuration for the "friendly" error formatter
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'