Browse Source

src: Add a monolog logger

master
Elis Hirwing 3 years ago
parent
commit
c5e7fca88c
Signed by: etu GPG Key ID: D57EFA625C9A925F
  1. 13
      public/index.php

13
public/index.php

@ -12,4 +12,17 @@ $app = new Slim\App();
$app->get('/inventory/{item}', function (Request $request, Response $response, array $args) {
});
/**
* Set up dependencies
*/
$container = $app->getContainer();
$container['logger'] = function (Slim\Container $c) {
$logger = new \Monolog\Logger('inventory-logger');
$logger->pushProcessor(new \Monolog\Processor\PsrLogMessageProcessor());
return $logger;
};
$app->run();

Loading…
Cancel
Save