mirror of
https://github.com/flextype/flextype.git
synced 2025-08-17 10:30:46 +02:00
Monolog integration #117
This commit is contained in:
@@ -39,7 +39,8 @@
|
||||
"league/event": "^2.2",
|
||||
"slim/csrf": "^0.8.3",
|
||||
"zeuxisoo/slim-whoops": "0.6.*",
|
||||
"respect/validation": "^1.0"
|
||||
"respect/validation": "^1.0",
|
||||
"monolog/monolog": "^1.24"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@@ -74,6 +74,17 @@ $flextype['csrf'] = function ($container) {
|
||||
return new \Slim\Csrf\Guard;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add logger
|
||||
*/
|
||||
$flextype['logger'] = function($container) {
|
||||
$logger = new \Monolog\Logger('flextype');
|
||||
$file_handler = new \Monolog\Handler\StreamHandler(PATH['site'] . '/logs/' . date('Y-m-d') . '.log');
|
||||
$logger->pushHandler($file_handler);
|
||||
return $logger;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add middleware CSRF (cross-site request forgery) protection for all routes
|
||||
*/
|
||||
|
Reference in New Issue
Block a user