ext-solr icon indicating copy to clipboard operation
ext-solr copied to clipboard

[BUG] Log errors in solr routing middleware spamming the solr logs

Open DenisMir opened this issue 3 years ago • 3 comments

Describe the bug When accessing static addresses like /sitemap.xml or custom APIs (with custom routing) the solr log gets spammed with error log messages from the solr routing middleware. (from the \ApacheSolrForTypo3\Solr\Middleware\SolrRoutingMiddleware)

It is spammed with messages like Could not determine page for slug "%1$s" and language "%2$s". Given path "%3$s".

I have disabled the middleware now with:

<?php

return [
    'frontend' => [
        'apache-solr-for-typo3/solr-route-enhancer' => [
            'disabled' => true
        ],
    ],
];

Since this feature is just an addon it doesn't hurt but I don't get why it is activated by default.

Expected behavior

  1. Disabled middleware (\ApacheSolrForTypo3\Solr\Middleware\SolrRoutingMiddleware) since it is not needed in the default setup
  2. No error logs like this for custom routes (info logs are ok)

Used versions (please complete the following information):

  • TYPO3 Version: 11.5.9
  • EXT:solr Version: 11.5.0-rc-1

Additional context Add any other context about the problem here.

DenisMir avatar Apr 19 '22 07:04 DenisMir

Release 11.2 affected as well.

dkd-kaehm avatar Apr 19 '22 07:04 dkd-kaehm

Happens for me mostly when 404 is triggered, so I configured the logging to not write errors from the SolrRoutingMiddleware

$GLOBALS['TYPO3_CONF_VARS']['LOG']['ApacheSolrForTypo3']['Solr']['Middleware']['SolrRoutingMiddleware'] = [
    'writerConfiguration' => [
        \TYPO3\CMS\Core\Log\LogLevel::ERROR => [
            \TYPO3\CMS\Core\Log\Writer\NullWriter::class => [],
       ]
    ]
];

Mabahe avatar Apr 28 '22 15:04 Mabahe

It will be fixed with #3339

christophlehmann avatar Sep 06 '22 05:09 christophlehmann