Created
August 3, 2017 10:27
-
-
Save sohelrana820/d226d867e3ae76520c068e4872363de1 to your computer and use it in GitHub Desktop.
Implementing CakePHP Logging Scope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author: Sohel Rana <me.sohelrana.me> | |
* @author URI: http://blog.sohelrana.me | |
* @licence; MIT | |
* @link: https://blog.sohelrana.me/using-cakephp-logging-scope | |
* | |
* Implementing CakePHP Logging Scope | |
*/ | |
// This will be cart scope | |
Log::setConfig('cart', [ | |
'className' => 'Cake\Log\Engine\FileLog', | |
'path' => LOGS, | |
'file' => 'cart.log', | |
'levels' => [], | |
'scopes' => ['cart'], | |
'url' => env('LOG_ERROR_URL', null), | |
]); | |
// This will be payment scope | |
Log::setConfig('payments', [ | |
'className' => 'Cake\Log\Engine\FileLog', | |
'path' => LOGS, | |
'file' => 'payments.log', | |
'levels' => [], | |
'scopes' => ['payments'], | |
'url' => env('LOG_ERROR_URL', null), | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment