Apache Solr open-source search software
SOLR-18319: Solr now logs core/collection not found (404) (#4666)
David Smileyc2a9d5092d28
diff --git a/changelog/unreleased/SOLR-18319-404-simplify.yml b/changelog/unreleased/SOLR-18319-404-simplify.ymlnew file mode 100644index 00000000000..a705474cbf6--- /dev/null+++ b/changelog/unreleased/SOLR-18319-404-simplify.yml@@ -0,0 +1,8 @@+title: >+ Solr's 404 page is less generic. We now log 404s in Solr's log.+type: changed+authors:+ - name: David Smiley+links:+ - name: SOLR-18319+ url: https://issues.apache.org/jira/browse/SOLR-18319diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.javaindex de25af4a9e9..3d80367921f 100644--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java@@ -318,9 +318,8 @@ public class HttpSolrCall {}}- String msg = "no handler, collection, or core for " + path;- sendError(404, msg);- log.info(msg); // not "error" since Solr isn't necessarily at fault+ sendError(404, "no handler, collection, or core for " + path);+ log.info("path={} status=404", path); // not "error" since Solr isn't necessarily at faultaction = RETURN;}diff --git a/solr/webapp/web/WEB-INF/web.xml b/solr/webapp/web/WEB-INF/web.xmlindex 04f949e2f6b..136cb6d4bd4 100644--- a/solr/webapp/web/WEB-INF/web.xml+++ b/solr/webapp/web/WEB-INF/web.xml@@ -167,9 +167,4 @@<url-pattern>/zookeeper</url-pattern></servlet-mapping>-->-- <error-page>- <error-code>404</error-code>- <location>/error404.html</location>- </error-page></web-app>diff --git a/solr/webapp/web/error404.html b/solr/webapp/web/error404.htmldeleted file mode 100644index 3d15bd69760..00000000000--- a/solr/webapp/web/error404.html+++ /dev/null@@ -1,21 +0,0 @@-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.--->-<p>- Searching for Solr?<br/>- You must type the correct path.<br/>- Solr will respond.-</p>