Returns an instance of Monolog with all configured handlers
added. The Monolog instance will be given $name.
@param $name
@return Logger
965505
public function getFor($name)
    {
        if (isset($this->cache[$name])) {
            return $this->cache[$name];
        }

        $handlers = $this->getHandlers(self::KEY_ALWAYS_LOADED);
        if ($name !== self::KEY_ALWAYS_LOADED) {
            $handlers = array_merge($handlers, $this->getHandlers($name));
        }

        $logger = new Logger($name, $handlers);
        ErrorHandler::register($logger);
        $this->cache[$name] = $logger;

        return $logger;
    }
933371
public function logger($name = null)
	{
		$name = $name ?: $this->getDefaultLog();

		// If the given driver has not been created before, we will create the instances
		// here and cache it so we can return it next time very quickly. If there is
		// already a driver created by this name, we'll just return that instance.
		if (! isset($this->loggers[$name]))
		{
			$this->loggers[$name] = $this->createLog($name);
		}

		return $this->loggers[$name];
	}
770547
@SuppressWarnings("unchecked")
	public static <T, L extends LoggerInformer> L getLogger(String name) {
		return (L)SLF4JLoggerFactory.getLogger(name);
	}
491551
static function create($name)
    {
        $logger = new Logger($name);
        $filename = SettingsPath::LOGS . mb_strtolower($name, 'UTF-8') . '.log';
        $handler = new RotatingFileHandler($filename);

        $handler->setFilenameFormat('{date}-{filename}', 'Y/m/d');

        $logger->pushHandler($handler);

        return $logger;
    }
42190
def get_logger(name=None):
    
    logging.setLoggerClass(CustomLogger)

    logger = logging.getLogger(name)
    logger.setLevel(logging.DEBUG)

    logger.addHandler(_get_info_handler())
    logger.addHandler(_get_out_handler())
    logger.addHandler(_get_warn_handler())
    logger.addHandler(_get_error_handler())
    logger.addHandler(_get_critical_handler())
    logger.addHandler(_get_success_handler())
    logger.propagate = False

    return logger
291782
protected function getHandlerInstanceByName($name){
        $config = (isset($this->config[$name]) ? $this->config[$name] : []);
        return Factory::create($name,$config,$this->title);
    }
594823
public static Logger getLogger(String name) {
        ILoggerFactory iLoggerFactory = getILoggerFactory();
        return iLoggerFactory.getLogger(name);
    }
736988
public function newFriendRequestAction($name)
    {
        $logFile = $this->container->getParameter('claroline.param.claroline_log');
        $host = $this->request->query->get('host');
        //uncomment this for debugging puroposes...

        if ($this->container->get('kernel')->getEnvironment() === 'dev') {
            $fileLogger = new \Monolog\Logger('claroline.debug.log');
            $fileLogger->pushHandler(new \Monolog\Handler\StreamHandler($logFile));
            $fileLogger->addInfo(var_export($this->oauthManager->isAutoCreated($host), true));
        }

        $this->oauthManager->addPendingFriendRequest(
            $name,
            $host,
            $this->oauthManager->isAutoCreated($host)
        );

        return new JsonResponse(array('name' => $name, 'host' => $host));
    }
811283
public function pushHandler($name, HandlerInterface $handler): LoggerInterface
    {
        $this->handlers->set($name, $handler);
        
        return $this;
    }
1133783
protected function createLog($name)
	{
		if (isset($this->setup[$name]))
		{
			$config = array_merge($this->defaults, $this->setup[$name]);

			if (!$config['path'])
			{
				throw new InvalidArgumentException("Log path not specified for [$name].");
			}

			if (!$config['file'])
			{
				throw new InvalidArgumentException("Log file name not specified for [$name].");
			}

			$log = new Writer(
				new Monolog($name),
				$config['dispatcher']
			);

			$log->useFiles(
				$config['path'] . DIRECTORY_SEPARATOR . $config['file'],
				$config['level'],
				$config['format'],
				$config['dateFormat'],
				$config['permissions']
			);

			return $log;
		}

		throw new InvalidArgumentException("Log [$name] has no configuration values.");
	}
1113389
public function getLogger ($name) {
    if (!isset($this->logs[$name])) {
      $this->logs[$name] = $this->newLogger($name, $this->findParent($name));
    }
    return $this->logs[$name];
  }
773381
public function setDefaultHandler($name)
    {
        if (!array_key_exists($name, $this->logRegistry)) {
            throw new \Exception('LogHandler named ['.$name.'] does not exist');
        }
        $this->defaultLogHandler = $name;
    }
134572
public static function create($name) {
		$name = static::slug($name);
		static::$hooks[$name] = new static($name);
		return self::$hooks[$name];
	}
22119
public static function get($name)
    {
        $class = get_called_class();
    
        if (!isset(self::$instance[$class])) {
            self::$instance[$class] = new static();
        }
        
        return self::$instance[$class]->getExtensions()->get($name);
    }
830702
public function getLogger($name = 'main')
    {
        if (!$this->hasLogger($name)) {
            throw new LoggerNotFoundException(sprintf("Logger instance '%s' not found", $name));
        }

        return $this->channels[$name];
    }
606347
public function getByName($name)
    {
        return isset($this->loggers[$name]) ? $this->loggers[$name] : null;
    }
1033103
public static function getLogger($name)
    {
        return Registry::hasLogger($name) ? Registry::getInstance($name) : self::createLogger($name);
    }