title: How to use monolog in slim 3?
body: <p>In my app.php file:</p>
  
  <pre><code>use Monolog\Logger;
  use Monolog\Handler\StreamHandler;
  
  class App extends \DI\Brifge\Slim\app
  {
   public function configureContainer(ContainerBuilder $builder)
   {
    $dependencies = [
              'logger' =&gt; function (Container $container) { 
              $logger = new Monolog\Logger('logger');
              $filename = _DIR__ . '/../log/error.log';
              $stream = new Monolog\Handler\StreamHandler($filename, Monolog\Logger::DEBUG);
              $fingersCrossed = new Monolog\Handler\FingersCrossedHandler(
              $stream, Monolog\Logger::ERROR);
              $logger-&gt;pushHandler($fingersCrossed);
  
              return $logger;
          },
        ];
      }
     }
  </code></pre>
  
  <p>In my custom error handler:</p>
  
  <pre><code>class CustomErrorHandler
  {
   protected $logger;
  
   public function __construct(Logger $logger)
   {
      $this-&gt;logger = $logger;
   }
  
   public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $exception)
   {
      $output = ['success'=&gt;0, 'error'=&gt;"Oops! Something's not right "];
  
      $this-&gt;logger-&gt;critical($output);
  
      return $response-&gt;withStatus(500)
                      -&gt;withHeader('Content-Type', 'application/json')
                      -&gt;write(json_encode($output));
   }
  }
  </code></pre>
  
  <p>When an error is thrown, following message is displayed:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Class 'App\Monolog\Logger' not found in C:\xampp\htdocs\backend\app\App.php:103 Stack trace: #0 [internal function]: App\App->App{closure}(Object(DI\Container)) #1 C:\xampp\htdocs\backend\vendor\php-di\invoker\src\Invoker.php(82): call_user_func_array(Object(Closure), Array) #2 C:\xampp\htdocs\backend\vendor\php-di\php-di\src\DI\Definition\Resolver\FactoryResolver.php(81): Invoker\Invoker->call(Object(Closure), Array) #3 C:\xampp\htdocs\backend\vendor\php-di\php-di\src\DI\Definition\Resolver\ResolverDispatcher.php(58): DI\Definition\Resolver\FactoryResolver->resolve(Object(DI\Definition\FactoryDefinition), Array) #4 C:\xampp\htdocs\backend\vendor\php-di\php-di\src\DI\Container.php(287): DI\Definition\Resolver\ResolverDispatcher->resolve(Object(DI\Definition\FactoryDefinition), Array) #5 C:\xampp\htdocs\backend\vendor\php-di\php-di\src\DI\Container.php(124): DI\Container->resolveDefinition(Object(DI\Definition\FactoryDefinition)) #6 C:\xampp\htdocs\backend\app\App.php(95): DI\Container->get('l in C:\xampp\htdocs\backend\app\App.php on line 103</p>
  </blockquote>
  
  <p>I have included the statement <code>use Monolog\Logger;</code> in App.php file but I get the above error.</p>