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
        }
    }
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
        }
    }
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 } }
Return's the logger with the requested name. First we look in the
application and then in the system itself.

@param string $loggerName The name of the logger to return

@return \Psr\Log\LoggerInterface The logger with the requested name
Return s the logger with the requested name . First we look in the application and then in the system itself .