AppserverIo\Appserver\ServletEngine\StandardGarbageCollector::getLogger PHP Method

getLogger() public method

Return's the logger with the requested name. First we look in the application and then in the system itself.
public getLogger ( string $loggerName ) : Psr\Log\LoggerInterface | null
$loggerName string The name of the logger to return
return Psr\Log\LoggerInterface | null The logger with the requested name
    public function getLogger($loggerName)
    {
        try {
            // first let's see if we've an application logger registered
            if ($logger = $this->getApplication()->getLogger($loggerName)) {
                return $logger;
            }
            // then try to load the global logger instance if available
            return $this->getApplication()->getNamingDirectory()->search(sprintf('php:global/log/%s', $loggerName));
        } catch (NamingException $ne) {
            // do nothing, we simply have no logger with the requested name
        }
    }