diff --git a/config/config.sample.php b/config/config.sample.php
index f45e7dcc5e0f6..2382d3db24b8c 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -2235,6 +2235,11 @@
*/
'upgrade.cli-upgrade-link' => '',
+/**
+ * Allows to modify the exception server logs documentation link in order to link to a different documentation
+ */
+'server_logs_documentation ' => '',
+
/**
* Set this Nextcloud instance to debugging mode
*
diff --git a/core/templates/exception.php b/core/templates/exception.php
index ee35510b26fa8..2ab461e4ebd69 100644
--- a/core/templates/exception.php
+++ b/core/templates/exception.php
@@ -25,6 +25,9 @@ function print_exception(Throwable $e, \OCP\IL10N $l): void {
t('The server was unable to complete your request.')) ?>
t('If this happens again, please send the technical details below to the server administrator.')) ?>
t('More details can be found in the server log.')) ?>
+
+ t('See this documentation how to retreive them.')) ?>
+
t('Technical details')) ?>
diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php
index 545d5a73a6311..919b462695234 100644
--- a/lib/private/legacy/OC_Template.php
+++ b/lib/private/legacy/OC_Template.php
@@ -306,6 +306,7 @@ public static function printExceptionErrorPage($exception, $statusCode = 503) {
http_response_code($statusCode);
try {
$debug = \OC::$server->getSystemConfig()->getValue('debug', false);
+ $serverLogsDocumentation = \OC::$server->getSystemConfig()->getValue('server_logs_documentation', '');
$request = \OC::$server->getRequest();
$content = new \OC_Template('', 'exception', 'error', false);
$content->assign('errorClass', get_class($exception));
@@ -315,6 +316,7 @@ public static function printExceptionErrorPage($exception, $statusCode = 503) {
$content->assign('line', $exception->getLine());
$content->assign('exception', $exception);
$content->assign('debugMode', $debug);
+ $content->assign('serverLogsDocumentation', $serverLogsDocumentation);
$content->assign('remoteAddr', $request->getRemoteAddress());
$content->assign('requestID', $request->getId());
$content->printPage();