public static function log($level, $message, $category = 'application')
    {
        if (LogLevel::DEBUG === $level && !YII_DEBUG) {
            return;
        }

        $logger = static::get('logger', null, false);
        if ($logger) {
            return $logger->log($level, $message, ['category' => $category]);
        }

        error_log($message);
    }