Logs a message

@param string $message Message to log
@param int $level Log level
@return bool
@throws LoggerFileException
557871
public function logMessage($message, $level = 0) {
        $this->getLogFile();
        if (!flock($this->_fp, LOCK_EX)) {
            throw new LoggerFileException('Can\'t obtain file lock for: ');
        }
        $text = '[' . date("H:i:s") . ']' . $this->_levelNames[$level] . " " . $message . "\n"; // Log message
        if (fwrite($this->_fp, $text)) {
            flock($this->_fp, LOCK_UN);
            return true;
        } else {
            flock($this->_fp, LOCK_UN);
            throw new LoggerFileException('Can\'t write to logfile!');
        }
    }
430650
public static function logToFile($message, $level)
    {
        if ($level > self::$config['level']) {
            return;
        }
        
        $filename = self::$config['filename'];
        $template = self::$config['message_template'];
        $tags = array(
            '%date%' => @date('Y-m-d H:i:s'), 
            '%level%' => $level,
            '%message%' => $message
        );
        
        $file = fopen($filename, 'a');
        fwrite($file, str_replace(array_keys($tags), array_values($tags), $template) . "\n");
        fclose($file);
        $file = null;
    }
301202
public function log($level, $message, array $context = array())
    {
        if (self::isSetLogger()) {
            return self::$logger->log($level, $message, $context);
        }

        return false;
    }
384481
public function log($level, $message, array $context = []) {
        $realMessage = rtrim(static::interpolate($message, $context), "\n");
        if (STDOUT) {
            echo "{$realMessage}\n";
        }
    }
1359484
public function log($level, $message, array $context = array())
    {
        $this->dispatcher->dispatch(Log::EVENT_NAME, new Log($level, $message, $context, []));
    }
35856
public function log($level, $message, array $context = []): void {
        if ($this->logger instanceof LoggerInterface) {
            $message = $this->interpolate($message, $context);
            $this->logger->log($level, $message, $context);
        }
    }
557160
public function log($level, $message, array $context = [])
    {
        /** @var LoggerInterface|AdapterInterface $logTarget */
        foreach ($this->logTargets as $logTarget) {
            if (($logTarget instanceof AdapterInterface)) {
                $logTarget->log($this->getPhalconLoggerLevel($level), $message, $context);
            } else {
                $logTarget->log($level, $message, $context);
            }
        }
    }
277266
public function log($level, $message, array $context = array())
    {
        return error_log(self::PREFIX.' '.strtoupper($level).': '.$message.' '.
            (!empty($context) ? print_r($context, true) : ''));
    }
210119
public static function log($level, $message, array $context = array())
    {
        return self::getInstance()->log($level, $message, $context);
    }
829937
public function log($level, $message, array $context = array()) {
		$message = strtr($message, $this->replacement);
		$this->logger()->log($level, $message, $context);
	}
1053170
public function log($level, $message, array $context = array())
    {
        $this->getApplication()->getInitialContext()->getSystemLogger()->log($level, $message, $context);
    }
1140768
public function log($message, $level = LogLevel::INFO, $context = array())
    {
        $this->buildLogger->log($message, $level, $context);
    }
1360679
public function log($message, $level = LogLevel::INFO, $context = array())
    {
        // Skip if no logger has been loaded.
        if (!$this->logger) {
            return;
        }

        if (!is_array($message)) {
            $message = array($message);
        }

        // The build is added to the context so the logger can use
        // details from it if required.
        $context['build'] = $this->build;

        foreach ($message as $item) {
            $this->logger->log($level, $item, $context);
        }
    }
1227826
public function log($level, $message, array $context = array())
    {
        if($context != []){
            /** @var DumpFile $dumpFile */
            $dumpFile = true;

            $t = $this->logFile->log($message, $level, $dumpFile);
            $dumpFile->writeSerialized($context);
        } else {
            $t = $this->logFile->log($message, $level);
        }

        return $t;

    }
396649
public function log($level, $message, array $context = array()) {
		$message = call_user_func($this->fn, $level, $message, $context);
		$this->logger()->log($level, $message, $context);
	}
1281260
private static function log(string $message, int $level) {
        \Logger::configure(self::getConfiguration());
        $logger = \Logger::getRootLogger();
        $logger->setLevel(self::getLoggerLevel());

        switch ($level) {
            case Logger::DEBUG:
                $logger->debug($message);
                break;
            case Logger::INFO:
                $logger->info($message);
                break;
            case Logger::WARN:
                $logger->warn($message);
                break;
            case Logger::ERROR:
                $logger->error($message);
                break;
            case Logger::FATAL:
                $logger->fatal($message);
                break;
            case Logger::TRACE:
                $logger->trace($message);
                break;
            default:
        }
    }
705791
public static function log($message, array $context = array(), $level = Logger::INFO, $logname = null)
    {
        $_this = self::getInstance();
        if ($_this->getOption('enable_logging')===false) {
            return;
        }
        $default_context = array(
            'url' => $_this->getRequest()->getUrl()
        );
        return self::getInstance()->getLogger()
            ->log($level, $message, array_merge($default_context, $context), $logname);
    }