aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2024-05-15 16:03:52 +0200
committerGitHub <noreply@github.com>2024-05-15 16:03:52 +0200
commitbc013ef5e77974dcad8d21279a347e6bd782d98e (patch)
treeb83339e673decb6086d56f80acc3bdf8af23d4a5
parent0ad77fa93755f3294631c3d021d7ddab83a9dcdf (diff)
parentcb646b2b8b5fb17a3ae7a635dd7130397e2a7685 (diff)
downloadnextcloud-server-bc013ef5e77974dcad8d21279a347e6bd782d98e.tar.gz
nextcloud-server-bc013ef5e77974dcad8d21279a347e6bd782d98e.zip
Merge pull request #45057 from nextcloud/enh/noid/server-log
feat(exception-template): allow to link to specific documentation for how to retreive server log
-rw-r--r--config/config.sample.php5
-rw-r--r--core/templates/exception.php3
-rw-r--r--lib/private/legacy/OC_Template.php2
3 files changed, 10 insertions, 0 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 751d6a5599b..c6fab26665d 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -2242,6 +2242,11 @@ $CONFIG = [
'upgrade.cli-upgrade-link' => '',
/**
+ * Allows to modify the exception server logs documentation link in order to link to a different documentation
+ */
+'documentation_url.server_logs' => '',
+
+/**
* Set this Nextcloud instance to debugging mode
*
* Only enable this for local development and not in production environments
diff --git a/core/templates/exception.php b/core/templates/exception.php
index ee35510b26f..f060d475b1f 100644
--- a/core/templates/exception.php
+++ b/core/templates/exception.php
@@ -25,6 +25,9 @@ function print_exception(Throwable $e, \OCP\IL10N $l): void {
<p><?php p($l->t('The server was unable to complete your request.')) ?></p>
<p><?php p($l->t('If this happens again, please send the technical details below to the server administrator.')) ?></p>
<p><?php p($l->t('More details can be found in the server log.')) ?></p>
+ <?php if (isset($_['serverLogsDocumentation']) && $_['serverLogsDocumentation'] !== ''): ?>
+ <p><a href="<?php print_unescaped($_['serverLogsDocumentation']) ?>" target="_blank" rel="noopener"><?php p($l->t('For more details see the documentation ↗.')) ?></a></p>
+ <?php endif; ?>
<h3><?php p($l->t('Technical details')) ?></h3>
<ul>
diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php
index 545d5a73a63..ad9421913d3 100644
--- a/lib/private/legacy/OC_Template.php
+++ b/lib/private/legacy/OC_Template.php
@@ -306,6 +306,7 @@ class OC_Template extends \OC\Template\Base {
http_response_code($statusCode);
try {
$debug = \OC::$server->getSystemConfig()->getValue('debug', false);
+ $serverLogsDocumentation = \OC::$server->getSystemConfig()->getValue('documentation_url.server_logs', '');
$request = \OC::$server->getRequest();
$content = new \OC_Template('', 'exception', 'error', false);
$content->assign('errorClass', get_class($exception));
@@ -315,6 +316,7 @@ class OC_Template extends \OC\Template\Base {
$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();