Log a message object with the ERROR level.

@param mixed $message message
@param Exception $throwable Optional throwable information to include
in the logging event.
164531
public function error($message, $throwable = null) {
		$this->log(\n2n\log4php\LoggerLevel::getLevelError(), $message, $throwable);
	}
213421
protected function logException(\Exception $exception, $message)
    {
        if (null !== $this->logger) {
            if (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) {
                $this->logger->critical($message, array('exception' => $exception));
            } else {
                $this->logger->error($message, array('exception' => $exception));
            }
        }
    }
707191
protected void log(LogLevel level,Object[] message,Throwable throwable)
    {
        if(level.getValue()>=this.logLevel.getValue())
        {
            //log the message
            this.logImpl(level,message,throwable);
        }
    }
554604
protected function log(\Exception $exception)
    {
        if (null !== $this->logger) {
            $message = sprintf(
                '%s: %s (uncaught exception) at %s line %s',
                get_class($exception),
                $exception->getMessage(),
                $exception->getFile(),
                $exception->getLine()
            );

            $this->logger->error($message, array('exception' => $exception));
        }
    }
645786
public void trace(Object message, Throwable exception) {
    log(Level.TRACE, message, exception);
  }
1067139
public function log($level, $message, array $context = array()) {
		if(is_object($message) && is_callable($message, '__toString')) {
			$message = (string)$message;
		}
		$message = $this->fetchMessageContext($message, $context);

		if(isset(static::$debugLevels[$level])) {
			$this->connector->getDebugDispatcher()->dispatchDebug($message, static::$debugLevels[$level], $this->ignoreTraceCalls);
		}
		elseif(isset(static::$errorsLevels[$level])) {
			if(isset($context['exception']) && ($context['exception'] instanceof \Exception || $context['exception'] instanceof \Throwable)) {
				$this->connector->getErrorsDispatcher()->dispatchException($context['exception']);
			}
			else {
				$this->connector->getErrorsDispatcher()->dispatchError(static::$errorsLevels[$level], $message, null, null, $this->ignoreTraceCalls);
			}
		}
		else {
			throw new InvalidArgumentException('Unknown log level "' . $level . '"');
		}
	}
334636
protected function logException(\Exception $exception): void
    {
        if (!$this->logger) {
            return;
        }

        $message = sprintf(
            'Exception thrown when handling an exception (%s: %s at %s line %s)',
            get_class($exception),
            $exception->getMessage(),
            $exception->getFile(),
            $exception->getLine()
        );

        $this->logger->log($this->level, $message, [
            'exception' => $exception,
        ]);
    }
1039036
private function logException(Throwable $exception, ContainerInterface $container, string $message): void
    {
        if ($container->has(LoggerInterface::class) === true) {
            /** @var LoggerInterface $logger */
            $logger = $container->get(LoggerInterface::class);

            // The sad truth is that when you have a problem logging might not be available (e.g. no permissions
            // to write on a disk). We can't do much with it and can only hope that the error information will be
            // delivered to the user other way.
            try {
                $logger->critical($message, ['exception' => $exception]);
            } catch (Exception $secondException) {
            }
        }
    }
279615
public function exceptionHandler(\Throwable $exception)
    {
        \BFW\Application::getInstance()
            ->getMonolog()
            ->getLogger()
            ->debug(
                'New exception catched.',
                [
                    'msg'  => $exception->getMessage(),
                    'file' => $exception->getFile(),
                    'line' => $exception->getLine()
                ]
            );
        
        $errorRender = $this->obtainExceptionRender();
        
        $this->callRender(
            $errorRender,
            'Exception Uncaught', 
            $exception->getMessage(), 
            $exception->getFile(), 
            $exception->getLine(), 
            $exception->getTrace(),
            $exception->getCode()
        );
    }
617489
public final void error(Object message, Throwable t) {
        if (isLevelEnabled(LOG_LEVEL_ERROR)) {
            log(LOG_LEVEL_ERROR, message, t);
        }
    }
553971
public function logMessage(Message $message): void
    {
        if (in_array($message->getLevel(), $this->config['log']) && !$this->inserting) {
            if ($this->insertFn !== null) {
                $insert = call_user_func($this->insertFn, $message, $this->config);

                if ($insert !== null) {

                    if (!is_object($insert)) {
                        throw new Exception('\'get_insert_fn\' function must return an instance of Insert; instead got type of ' . gettype($insert));
                    } else {
                        // it is object, but what type
                        if (!($insert instanceof Insert)) {
                            throw new Exception('\'get_insert_fn\' function must return an instance of Insert; instead got instance of ' . get_class($insert));
                        }
                    }

                }
            } else {
                $data = [
                  'time' => $message->getTime()->format('Y-m-d H:i:s'),
                  'level' => $message->getLevel(),
                  'who' => $message->getWho() ?? Log::getWho(),
                  'message' => $message->getMessage()
                ];

                $insert = new Insert($this->getTableName(), $data, $this->getAdapterConnection());
            }

            if ($insert !== null) {
                $this->inserting = true;

                try {

                    Log::temporaryDisable();
                    $insert->exec();

                } catch (\Exception $e) {
                    throw $e;

                } finally {
                    Log::restoreTemporaryDisablement();
                    // @todo write tests for failures
                    $this->inserting = false;
                }
            }
        }
    }
698918
public void error(Object message, Throwable exception) {
    log(Level.ERROR, message, exception);
  }
1112392
public static function error($message)
    {
        if (!self::isEnabled()) {
            return;
        }

        $message .= ' (This error is only shown in development mode)';

        if (SettingsServer::isTrackerApiRequest()
            || Common::isPhpCliMode()
        ) {
            StaticContainer::get(LoggerInterface::class)->error($message, [
                'ignoreInScreenWriter' => true,
            ]);
        } else {
            throw new Exception($message);
        }
    }
880808
@Override
    protected void logImpl(LogLevel level,Object[] message,Throwable throwable)
    {
        //format log message (without exception)
        String text=this.formatLogMessage(level,message,null);

        //get log level
        int levelValue=level.getValue();
        switch(levelValue)
        {
            case LogLevel.DEBUG_LOG_LEVEL_VALUE:
                this.APACHE_LOGGER.debug(text);
                break;
            case LogLevel.ERROR_LOG_LEVEL_VALUE:
                this.APACHE_LOGGER.error(text,throwable);
                break;
            case LogLevel.INFO_LOG_LEVEL_VALUE:
            default:
                this.APACHE_LOGGER.info(text);
                break;
        }
    }
669507
public static function exceptionHandler(\Throwable $throwable)
    {
        self::showError($throwable);

        Log::error((string)$throwable);
    }
900745
protected function logException(\Exception $exception)
    {
        try {
            $this->logger->error($exception->getMessage() , array('exception' => $exception));
        } catch (\Exception $exception) {
            trigger_error("Error logging Monitor exception: ".$exception->getMessage());
        }
    }
1355523
public function logError(string $message = '', ?string $source = null, ?string $exception = null): bool
    {
        $ret = false;
        if ($this->logLevel & Log::LOG_ERROR) {
            $ret = $this->rawLog('[  ERROR]', $message, $source, $exception);
        }
        return $ret;
    }