I cant log a message using
$this->logger->log('hi');
i am getting undefined method call for
- log
- critical
- error
- info and others too...
I registered logger as a service such as
$di->set('logger', function () {
$loggerConfigs = $this->getConfig()->logger;
$filename = trim($loggerConfigs->get('filename'), '\\/');
$path = rtrim($loggerConfigs->get('path'), '\\/') . DIRECTORY_SEPARATOR;
$formatter = new FormatterLine($loggerConfigs->get('format'), $loggerConfigs->get('date'));
$logger = new FileLogger($path . $filename);
$logger->setFormatter($formatter);
return $logger;
});
Then using this service gives me error.
Any idea?