DOCS Change "Injector" to "SilverStripe\Core\Injector\Injector" in Logger examples

This commit is contained in:
Robbie Averill 2017-01-06 14:37:27 +13:00 committed by GitHub
parent 9ee3be9337
commit 47ab244f0a

View File

@ -94,7 +94,7 @@ for you to try.
To send emails, you can use Monolog's [NativeMailerHandler](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/NativeMailerHandler.php#L74), like this: To send emails, you can use Monolog's [NativeMailerHandler](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/NativeMailerHandler.php#L74), like this:
Injector: SilverStripe\Core\Injector\Injector:
Logger: Logger:
calls: calls:
MailHandler: [ pushHandler, [ %$MailHandler ] ] MailHandler: [ pushHandler, [ %$MailHandler ] ]
@ -119,7 +119,7 @@ The calls key, `MailHandler`, can be anything you like: its main purpose is to l
To log to a file, you can use Monolog's [StreamHandler](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/StreamHandler.php#L74), like this: To log to a file, you can use Monolog's [StreamHandler](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/StreamHandler.php#L74), like this:
Injector: SilverStripe\Core\Injector\Injector:
Logger: Logger:
calls: calls:
LogFileHandler: [ pushHandler, [ %$LogFileHandler ] ] LogFileHandler: [ pushHandler, [ %$LogFileHandler ] ]
@ -136,7 +136,7 @@ The log file will be relative to the framework/ path, so "../silverstripe.log" w
You can disable a handler by removing its pushHandlers call from the calls option of the Logger service definition. You can disable a handler by removing its pushHandlers call from the calls option of the Logger service definition.
The handler key of the default handler is `DisplayErrorHandler`, so you can disable it like this: The handler key of the default handler is `DisplayErrorHandler`, so you can disable it like this:
Injector: SilverStripe\Core\Injector\Injector:
Logger: Logger:
calls: calls:
DisplayErrorHandler: %%remove%% DisplayErrorHandler: %%remove%%
@ -152,7 +152,7 @@ non-dev.
Only: Only:
environment: dev environment: dev
--- ---
Injector: SilverStripe\Core\Injector\Injector:
Logger: Logger:
calls: calls:
- [ pushHandler, [ %$DisplayErrorHandler ]] - [ pushHandler, [ %$DisplayErrorHandler ]]
@ -167,7 +167,7 @@ non-dev.
Except: Except:
environment: dev environment: dev
--- ---
Injector: SilverStripe\Core\Injector\Injector:
Logger: Logger:
calls: calls:
- [ pushHandler, [ %$LogFileHandler ]] - [ pushHandler, [ %$LogFileHandler ]]
@ -225,7 +225,7 @@ others.
Monolog comes by default with SilverStripe, but you may use another PSR-3 compliant logger, if you wish. To do this, Monolog comes by default with SilverStripe, but you may use another PSR-3 compliant logger, if you wish. To do this,
set the `Injector.Logger` configuration parameter, providing a new injector definition. For example: set the `Injector.Logger` configuration parameter, providing a new injector definition. For example:
Injector: SilverStripe\Core\Injector\Injector:
ErrorHandler: ErrorHandler:
class: Logging\Logger class: Logging\Logger
constructor: constructor:
@ -246,7 +246,7 @@ configuration. It does a number of things:
This error handler is flexible enough to work with any PSR-3 logging implementation, but sometimes you will want to use This error handler is flexible enough to work with any PSR-3 logging implementation, but sometimes you will want to use
another. To replace this, you should registered a new service, `ErrorHandlerLoader`. For example: another. To replace this, you should registered a new service, `ErrorHandlerLoader`. For example:
Injector: SilverStripe\Core\Injector\Injector:
ErrorHandlerLoader: ErrorHandlerLoader:
class: MyApp\CustomErrorHandlerLoader class: MyApp\CustomErrorHandlerLoader