ext-solr
ext-solr copied to clipboard
[BUG] Log errors in solr routing middleware spamming the solr logs
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
- Disabled middleware (
\ApacheSolrForTypo3\Solr\Middleware\SolrRoutingMiddleware) since it is not needed in the default setup - 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.
Release 11.2 affected as well.
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 => [],
]
]
];
It will be fixed with #3339