diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-03-07 10:24:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-07 10:24:03 +0100 |
commit | 1e026a98af99e84e761d47b5d7b74a739d3012ed (patch) | |
tree | 5166655d0a45a1faab9e04319418aa9839d88606 | |
parent | e1b91fecf18735a3e6dbd353f226807e56b9d527 (diff) | |
parent | bbc6eee8032061d3de5aced8da60e9342fd6047d (diff) | |
download | nextcloud-server-1e026a98af99e84e761d47b5d7b74a739d3012ed.tar.gz nextcloud-server-1e026a98af99e84e761d47b5d7b74a739d3012ed.zip |
Merge pull request #37026 from nextcloud/fix/route-logs
fix: Avoid log spam on 404 routes not using GET
-rw-r--r-- | lib/base.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php index b5c5845b5a0..be931e70d55 100644 --- a/lib/base.php +++ b/lib/base.php @@ -80,6 +80,7 @@ use OCP\Server; use OCP\Share; use OCP\User\Events\UserChangedEvent; use Psr\Log\LoggerInterface; +use Symfony\Component\Routing\Exception\MethodNotAllowedException; use function OCP\Log\logger; require_once 'public/Constants.php'; @@ -1097,7 +1098,9 @@ class OC { try { Server::get(\OC\Route\Router::class)->match('/error/404'); } catch (\Exception $e) { - logger('core')->emergency($e->getMessage(), ['exception' => $e]); + if (!$e instanceof MethodNotAllowedException) { + logger('core')->emergency($e->getMessage(), ['exception' => $e]); + } $l = Server::get(\OCP\L10N\IFactory::class)->get('lib'); OC_Template::printErrorPage( $l->t('404'), |