Logs exception with optional message override

@param Exception $exception
@param string    $message
436773
public function logError(Exception $exception, $message = '')
    {
        if (empty($message)) {
            $message = $exception->getMessage();
        }

        array_push($this->store, array(
            'data' => $message,
            'file' => $exception->getFile(),
            'line' => $exception->getLine(),
            'type' => 'error'
        ));
    }
1087970
public void logWarning(String message, Exception exception) {
        if (!(logWarning || globalLog.logWarning))
            return;

        if (warningLog != null)
            log(warningLog, "WARNING", owner, message, exception);
        else 
            log(globalLog.warningLog, "WARNING", owner, message, exception);
    }
760532
public function err( $message )
	{
		$ex = new Exception();
		echo $ex->getTraceAsString();

		if ( ! $this->log ) return;
		return $this->log->err( $message );
	}
429358
public function logException(\Exception $e)
    {
        $error = $e->getMessage() . $e->getTraceAsString();
        return $this->logEmergency($error);
    }
1260024
public function exceptionHandler(Exception $exception)
    {
        $this->logger->addError($exception->getMessage(), array($exception->getFile(), $exception->getLine()));
        exit(-1);
    }
749347
public static function log(Exception $e)
    {
        Base::getLog()->error($e->getMessage(), [
            'code' => $e->getCode(),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
        ]);
    }
200084
protected function logException(\Exception $exception)
    {
        if (!$exception instanceof \OxidEsales\Eshop\Core\Exception\StandardException) {
            $exception = new \OxidEsales\Eshop\Core\Exception\StandardException($exception->getMessage(), $exception->getCode(), $exception);
        }
        \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
    }
1329586
protected function exception_handler($message, $throwException=false) {
		$logId = null;
		try {
			$this->lastException = $message;
			if(function_exists('cs_debug_backtrace')) {
				$message .= "\n\nBACKTRACE:::\n". cs_debug_backtrace(0);
			}
			$this->flogger($message);
			$logId = $this->do_log($message, 'exception in code');
			if($throwException === true) {
				//in this class, it is mostly useless to throw exceptions, so by default they're not thrown.
				throw new exception($message);
			}
		}
		catch(Exception $e) {
			$this->flogger($e->getMessage());
		}
		return($logId);
	}
371141
private function logError(Throwable $throwable, string $message): void
    {
        if ($this->logger !== null && $this->shouldBeLogged($throwable) === true) {
            // on error (e.g. no permission to write on disk or etc) ignore
            try {
                $this->logger->error($message, ['error' => $throwable]);
            } catch (Exception $exception) {
            }
        }
    }
846452
public function logException( Exception $exception,
                                  $priority = Logger::CRIT )
    {
        /* @var $logger \Zork\Log\LoggerManager */
        $logger = $this->getServiceLocator()
                       ->get( 'Zork\Log\LoggerManager' );

        if ( $logger->hasLogger( 'exception' ) )
        {
            $logger->getLogger( 'exception' )
                   ->log( $priority,
                          '<pre>' . $exception . PHP_EOL . '</pre>' . PHP_EOL );
        }
    }
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());
        }
    }
361043
protected function logExceptionAndThrow($exception, LogOperation $log = null)
    {
        if ($this->shouldLog($log) && is_null($log->getStartTime())) {
            $this->logStart($log);
        }
        if ($this->shouldLog($log)) {
            $log->setError($exception->getMessage());
        }

        throw $exception;
    }
38685
public function logException(\Exception $exception, $prefix = "Exception thrown")
    {
        $class = new \ReflectionClass($exception);
        $this->logger->critical("$prefix [{$class->getName()}] {$exception->getMessage()} on line {$exception->getLine()} of {$exception->getFile()}\n");
        $this->logger->debug("Debug trace for exception: {$exception->getTraceAsString()}");
    }
615633
private function eventMsg(\Exception $exception)
    {
        return sprintf('%s (%s line:%s)', $exception->getMessage(), $exception->getFile(), $exception->getLine());
    }
754165
public void error(final String message, final Exception exception) {
        messages.add(new LogMessage(message + " " + exception.getMessage(), LogMessage.Type.ERROR));
        log.error(message, exception);
    }
425476
public function log(Message $message, \Exception $e)
    {
        $sql = "UPDATE " . $this->messageTable . "
                SET log = :log
                WHERE message_id = :id
        ";
        $stmt = $this->getDb()->prepare($sql);
        $stmt->bindValue(':log', $e->getMessage(), \PDO::PARAM_STR);
        $stmt->bindValue(':id', $message->message_id, \PDO::PARAM_INT);
        $stmt->execute();
    }
499006
protected function _logInternalError($exception)
    {
        // Disable trace for internal errors.
        $this->_options['trace'] = false;
        $message = sprintf(
            "[%s] %s\n%s", // Keeping same message format
            get_class($exception),
            $exception->getMessage(),
            $exception->getTraceAsString()
        );
        trigger_error($message, E_USER_ERROR);
    }