Returns Logger instance.
@since 1.0
@return mixed.
321320
public static function instance()
	{
		if ( ! isset( self::$logger ) ) {
			self::$logger = new Logger( self::$path );
		}
		return self::$logger;
	}
459206
private function createLogger(): LoggerInterface
    {
        $container = $this->iocContainer();
        if (empty($container) || !$container->has(LogsInterface::class)) {
            return new NullLogger();
        }

        //We are using class name as log channel (name) by default
        return $container->get(LogsInterface::class)->getLogger(static::class);
    }
196208
public function getLogManager(): ?LogManager
    {
        if (!$this->hasLogManager()) {
            $this->setLogManager($this->getDefaultLogManager());
        }
        return $this->logManager;
    }
284580
protected function getLogger()
    {
        if (!isset($this->loggerClasses[$this->type])) {
            throw new OutOfBoundsException($this->translate(
                'Logger type "{type}" does not exist.',
                ['type' => $this->type]
            ));
        }

        $prototype = $this->getPrototype($this->loggerClasses[$this->type], ['umi\log\ILogger']);

        return $prototype->createSingleInstance(
            [$this->options],
            [],
            function(ILogger $logger)
            {
                $logger
                    ->setMinLevel($this->minLevel)
                    ->setMessageFormat($this->messageFormat);
            }
        );
    }
460331
public function getLogFile() {

        if ($this->_fp === null) {
            $this->LOG_DIR = ROOT .DS. 'app' . DS .  'logs';
            $filename      = $this->LOG_DIR . DS . date("Y-m-d");
            $this->_fp     = fopen($filename, 'a');
            if ($this->_fp === false) {
                throw new LoggerException('Cannot open log file: ' . $filename);
            }
            chmod($filename, 0774);
        }

        return $this->_fp;

    }
172224
public function create() : LoggerInterface
    {
        $loggerType = $this->config['type'] ?? 'null';
        switch ($loggerType) {
            case 'file':
                return new Logger($this->config['path'], $this->config['level']);
            case 'null':
                return new NullLogger;
            default:
                throw new \RuntimeException('Invalid logger type');
        }
    }
706776
private function getDebugLogger()
    {
        foreach ($this->processors as $processor) {
            if ($processor instanceof DebugLoggerInterface) {
                return $processor;
            }
        }

        foreach ($this->handlers as $handler) {
            if ($handler instanceof DebugLoggerInterface) {
                return $handler;
            }
        }
    }
1313070
public function getLogger()
    {
        $logger = app('log');

        // Laravel < 5.6
        if ($logger instanceof \Illuminate\Log\Writer) {
            return $logger->getMonolog();
        }

        // Laravel >= 5.6
        return $logger->getLogger();
    }
669198
public synchronized Logger getLogger() {
    if (m_Logger == null) {
      m_Logger = Logger.getLogger(getClass().getName());
      m_Logger.setLevel(LoggingHelper.getLevel(getClass()));
    }
    return m_Logger;
  }
1153528
protected function createEmergencyLogger()
    {
        return new Logger(new Monolog('laravel', $this->prepareHandlers([new StreamHandler(
                $this->app->storagePath().'/logs/laravel.log', $this->level(['level' => 'debug'])
        )])), $this->app['events']);
    }
1047702
public static function getBackend()
    {
        if(!is_object(self::$backend))
        {
            self::$backend = new \Monolog\Logger(self::$name);
            self::$backend->pushHandler(self::getStreamHandler());
            self::setLogFormat(self::$logFormat);
        }
        return self::$backend;
    }
647142
public function getLogger($name = null)
    {
        if (null === $name && !isset($this->loggers['nullLogger'])) {
            $this->createNullLogger();
            $name = 'nullLogger';
        }

        return $this->loggers[$name];
    }
84090
public static function getInstance(
        \FreeFW\Application\Config $p_config,
        \Psr\Log\LoggerInterface $p_logger
    ) {
        if (self::$instance === null) {
            self::$instance = new static($p_config, $p_logger);
        }
        return self::$instance;
    }
1227634
public static function getILoggerFactory () {
    static $nop;
    if (null === self::$factory) {
      if (null == $nop) {
        $nop = new NOPLoggerFactory();
      }
      return $nop;
    }
    return self::$factory;
  }
70982
public function getLogBuilder()
    {
        if (!is_object($this->_logBuilder)) {
            $this->_logBuilder = Yii::createObject($this->_logBuilder);
        }
        return $this->_logBuilder;
    }
1258191
protected function getLogger()
    {
        if (!isset($this->logger)) {
            // When no logger is injected, create a new one
            // that doesn't do anything
            $this->logger = new Logger('api-client');
            $this->logger->setHandlers([
                new NullHandler(),
            ]);
        }

        return $this->logger;
    }
1362760
public function getLog(string $logger = 'default'): LoggerInterface
    {
        if (!isset($this->loggers[$logger])) {
            if ($logger === 'default') {
                if (!isset($this->implicit['logger'])) {
                    throw new \RuntimeException('The default logger was not set');
                }
                $this->loggers[$logger] = $this->implicit['logger'];
            } else {
                $this->loggers[$logger] = $this->getCollector()->getLogger($logger);
            }
        }

        return $this->loggers[$logger];
    }