Apache Solr open-source search software
SOLR-14142 Enable jetty's request log by default (#536)
Jan Høydahl1d761d231519
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 05a081a8086..3523b06e828 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -481,6 +481,9 @@ Other Changes* SOLR-14858: Add the server WEB-INF/lib directory to the classpath for the solr-exporter script. Will allow the scriptto work when the dist/solrj-lib jars are missing in the Docker image. (Houston Putman)+* SOLR-14142: Jetty's RequestLog is enabled by default. If you don't want these logs, you can disable+ via SOLR_REQUESTLOG_ENABLED=false. (rmuir, janhoy)+* SOLR-15924: Remove lucene-libs from contrib module packaging. The lucene libraries will be included in lib/ with all other dependencies. (Houston Putman)Bug Fixesdiff --git a/solr/bin/solr b/solr/bin/solrindex d0a64d79cab..898648ebc9f 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -270,7 +270,7 @@ elsefi# Requestlog options-if [ "$SOLR_REQUESTLOG_ENABLED" == "true" ]; then+if [ "${SOLR_REQUESTLOG_ENABLED:-true}" == "true" ]; thenSOLR_JETTY_CONFIG+=("--module=requestlog")fidiff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmdindex 03cbd2d0943..af25f9ab509 100755--- a/solr/bin/solr.cmd+++ b/solr/bin/solr.cmd@@ -150,6 +150,9 @@ IF "%SOLR_SSL_ENABLED%"=="true" ()REM Requestlog options+IF NOT DEFINED SOLR_REQUESTLOG_ENABLED (+ set SOLR_REQUESTLOG_ENABLED=true+)IF "%SOLR_REQUESTLOG_ENABLED%"=="true" (set "SOLR_JETTY_CONFIG=!SOLR_JETTY_CONFIG! --module=requestlog")diff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmdindex 95da0aac394..ca411f9adcd 100755--- a/solr/bin/solr.in.cmd+++ b/solr/bin/solr.in.cmd@@ -102,7 +102,7 @@ REM Location where Solr should write logs to. Absolute or relative to solr startREM set SOLR_LOGS_DIR=logsREM Enables jetty request log for all requests-REM set SOLR_REQUESTLOG_ENABLED=false+REM set SOLR_REQUESTLOG_ENABLED=trueREM Sets the port Solr binds to, default is 8983REM set SOLR_PORT=8983diff --git a/solr/bin/solr.in.sh b/solr/bin/solr.in.shindex e1daa012b17..37e2ff8fc6f 100644--- a/solr/bin/solr.in.sh+++ b/solr/bin/solr.in.sh@@ -126,7 +126,7 @@#SOLR_LOGS_DIR=logs# Enables jetty request log for all requests-#SOLR_REQUESTLOG_ENABLED=false+#SOLR_REQUESTLOG_ENABLED=true# Sets the port Solr binds to, default is 8983#SOLR_PORT=8983diff --git a/solr/server/etc/jetty-requestlog.xml b/solr/server/etc/jetty-requestlog.xmlindex 34a1e90200a..d976ebf0d88 100644--- a/solr/server/etc/jetty-requestlog.xml+++ b/solr/server/etc/jetty-requestlog.xml@@ -30,7 +30,7 @@<New class="org.eclipse.jetty.server.AsyncRequestLogWriter"><Arg><Property name="solr.log.dir" default="logs"/>/yyyy_mm_dd.request.log</Arg><Set name="filenameDateFormat">yyyy_MM_dd</Set>- <Set name="retainDays">90</Set>+ <Set name="retainDays"><Property name="solr.log.requestlog.retaindays" default="3"/></Set><Set name="append">true</Set><Set name="timeZone">UTC</Set></New>diff --git a/solr/solr-ref-guide/src/configuring-logging.adoc b/solr/solr-ref-guide/src/configuring-logging.adocindex 21c658ec0c4..e14fb8851ac 100644--- a/solr/solr-ref-guide/src/configuring-logging.adoc+++ b/solr/solr-ref-guide/src/configuring-logging.adoc@@ -150,3 +150,10 @@ The log file under which you can find all these queries is called `solr_slow_reqIn addition to the logging options described above, it's possible to log only a selected list of request parameters (such as those sent with queries) with an additional request parameter called `logParamsList`.See the section on <<common-query-parameters.adoc#logparamslist-parameter,logParamsList Parameter>> for more information.++== Request Logging++Every incoming HTTP(s) request is by default logged in the standard https://en.wikipedia.org/wiki/Common_Log_Format[`NCSA format`]+in files with name `$SOLR_LOG_DIR/<yyyy_mm_dd>.request.log`, rolled over daily. By default, 3 days worth of request logs are retained.+You can disable request logging by setting `SOLR_REQUESTLOG_ENABLED=false` via environment variable or in `solr.in.sh`/`solr.in.cmd`.+You can change the number of days to retain by system property `-Dsolr.log.requestlog.retaindays`.diff --git a/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc b/solr/solr-ref-guide/src/major-changes-in-solr-9.adocindex 1033fb02e7f..dcf0a89d02b 100644--- a/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc+++ b/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc@@ -85,6 +85,8 @@ All the usages are replaced by BaseHttpSolrClient.RemoteSolrException and BaseHt* SOLR-11623: Every request handler in Solr now implements PermissionNameProvider. Any custom or 3rd party request handler must also do this+* SOLR-14142: Jetty low level request-logging in NCSA format is now enabled by default, with a retention of 3 days worth of logs.+ This may require some more disk space for logs than was the case in 8.x. See Reference Guide chapter "Configuring Logging" for how to change this.== New Features & Enhancementsdiff --git a/solr/solr-ref-guide/src/securing-solr.adoc b/solr/solr-ref-guide/src/securing-solr.adocindex 39162eb8d64..76f65f47285 100644--- a/solr/solr-ref-guide/src/securing-solr.adoc+++ b/solr/solr-ref-guide/src/securing-solr.adoc@@ -80,11 +80,6 @@ The authorization plugins that ship with Solr are:Audit logging will record an audit trail of incoming reqests to your cluster, such as users being denied access to admin APIs.Learn more about audit logging and how to implement an audit logger plugin in the section <<audit-logging.adoc#,Audit Logging>>.-== Request Logging--Solr can optionally log every incoming HTTP(s) request in the standard https://en.wikipedia.org/wiki/Common_Log_Format[`NCSA format`].-You can enable request logging by setting `SOLR_REQUESTLOG_ENABLED=true` via environment variable or in `solr.in.sh`/`solr.in.cmd`.-== IP Access ControlRestrict network access to specific hosts, by setting `SOLR_IP_ALLOWLIST`/`SOLR_IP_DENYLIST` via environment variables or in `solr.in.sh`/`solr.in.cmd`.