From f8eec1a87742f8b2b7490fea07b86640d226ab96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 10:12:35 +0100 Subject: [PATCH 01/11] SOLR-14142 Enable jetty's request log by default (SOLR_REQUESTLOG_ENABLED defaults to true) --- solr/CHANGES.txt | 3 +++ solr/bin/solr | 2 +- solr/bin/solr.cmd | 3 +++ solr/bin/solr.in.cmd | 2 +- solr/bin/solr.in.sh | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 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 script to 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 Fixes diff --git a/solr/bin/solr b/solr/bin/solr index d0a64d79cab..898648ebc9f 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -270,7 +270,7 @@ else fi # Requestlog options -if [ "$SOLR_REQUESTLOG_ENABLED" == "true" ]; then +if [ "${SOLR_REQUESTLOG_ENABLED:-true}" == "true" ]; then SOLR_JETTY_CONFIG+=("--module=requestlog") fi diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 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.cmd index 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 start REM set SOLR_LOGS_DIR=logs REM Enables jetty request log for all requests -REM set SOLR_REQUESTLOG_ENABLED=false +REM set SOLR_REQUESTLOG_ENABLED=true REM Sets the port Solr binds to, default is 8983 REM set SOLR_PORT=8983 diff --git a/solr/bin/solr.in.sh b/solr/bin/solr.in.sh index 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=8983 From bb171189147a4b0731432c3e4152625e430a1608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 11:53:21 +0100 Subject: [PATCH 02/11] Limit request logs to last 3 days to preserve disk space. --- solr/server/etc/jetty-requestlog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/server/etc/jetty-requestlog.xml b/solr/server/etc/jetty-requestlog.xml index 34a1e90200a..d976ebf0d88 100644 --- a/solr/server/etc/jetty-requestlog.xml +++ b/solr/server/etc/jetty-requestlog.xml @@ -30,7 +30,7 @@ /yyyy_mm_dd.request.log yyyy_MM_dd - 90 + true UTC From c55aa37e5faee408eaa6dc287ea44117980d93d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 12:03:11 +0100 Subject: [PATCH 03/11] Make logging rollover configurable by system properties --- solr/server/resources/log4j2.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/solr/server/resources/log4j2.xml b/solr/server/resources/log4j2.xml index 4ec2fa2ecfb..551b72c5ef0 100644 --- a/solr/server/resources/log4j2.xml +++ b/solr/server/resources/log4j2.xml @@ -39,9 +39,9 @@ - + - + - + - + From e338202ea0425ac84bae064110bbc4f0a341d650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 12:07:25 +0100 Subject: [PATCH 04/11] Rename props --- solr/server/resources/log4j2.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/solr/server/resources/log4j2.xml b/solr/server/resources/log4j2.xml index 551b72c5ef0..08e9bc537ef 100644 --- a/solr/server/resources/log4j2.xml +++ b/solr/server/resources/log4j2.xml @@ -39,9 +39,9 @@ - + - + - + - + From fcd388a146c1f1b002ec138bbe84862873575dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 13:29:01 +0100 Subject: [PATCH 05/11] Revert "Rename props" This reverts commit e338202ea0425ac84bae064110bbc4f0a341d650. --- solr/server/resources/log4j2.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/solr/server/resources/log4j2.xml b/solr/server/resources/log4j2.xml index 08e9bc537ef..551b72c5ef0 100644 --- a/solr/server/resources/log4j2.xml +++ b/solr/server/resources/log4j2.xml @@ -39,9 +39,9 @@ - + - + - + - + From b35c776bafb9663093e2275606bd3b1e961a48d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 13:29:01 +0100 Subject: [PATCH 06/11] Revert "Make logging rollover configurable by system properties" This reverts commit c55aa37e5faee408eaa6dc287ea44117980d93d7. --- solr/server/resources/log4j2.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/solr/server/resources/log4j2.xml b/solr/server/resources/log4j2.xml index 551b72c5ef0..4ec2fa2ecfb 100644 --- a/solr/server/resources/log4j2.xml +++ b/solr/server/resources/log4j2.xml @@ -39,9 +39,9 @@ - + - + - + - + From bc0c9b90d74021fc33c5d9e4dc9de9d33fbfa0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 13:34:27 +0100 Subject: [PATCH 07/11] RefGuide changes --- solr/solr-ref-guide/src/securing-solr.adoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/solr/solr-ref-guide/src/securing-solr.adoc b/solr/solr-ref-guide/src/securing-solr.adoc index 39162eb8d64..a9f38cdce9b 100644 --- a/solr/solr-ref-guide/src/securing-solr.adoc +++ b/solr/solr-ref-guide/src/securing-solr.adoc @@ -82,8 +82,10 @@ Learn more about audit logging and how to implement an audit logger plugin in th == 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`. +Every incoming HTTP(s) request in by default logged in the standard https://en.wikipedia.org/wiki/Common_Log_Format[`NCSA format`] +in the file `$SOLR_LOG_DIR/.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`. == IP Access Control From 8a889da1a404aaa7cb41483b050037a0b373d7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 13:38:47 +0100 Subject: [PATCH 08/11] Moving "Request logging" paragraph from securing-solr.adoc to configuring-logging.adoc --- solr/solr-ref-guide/src/configuring-logging.adoc | 7 +++++++ solr/solr-ref-guide/src/securing-solr.adoc | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/solr/solr-ref-guide/src/configuring-logging.adoc b/solr/solr-ref-guide/src/configuring-logging.adoc index 21c658ec0c4..de1dc95aea7 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_req In 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 <> for more information. + +== Request Logging + +Every incoming HTTP(s) request in by default logged in the standard https://en.wikipedia.org/wiki/Common_Log_Format[`NCSA format`] +in the file `$SOLR_LOG_DIR/.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/securing-solr.adoc b/solr/solr-ref-guide/src/securing-solr.adoc index a9f38cdce9b..76f65f47285 100644 --- a/solr/solr-ref-guide/src/securing-solr.adoc +++ b/solr/solr-ref-guide/src/securing-solr.adoc @@ -80,13 +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 <>. -== Request Logging - -Every incoming HTTP(s) request in by default logged in the standard https://en.wikipedia.org/wiki/Common_Log_Format[`NCSA format`] -in the file `$SOLR_LOG_DIR/.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`. - == IP Access Control Restrict network access to specific hosts, by setting `SOLR_IP_ALLOWLIST`/`SOLR_IP_DENYLIST` via environment variables or in `solr.in.sh`/`solr.in.cmd`. From 92b20543a316851645eb6762cdf75841466ab0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 13:53:22 +0100 Subject: [PATCH 09/11] Bugfix docs --- solr/solr-ref-guide/src/configuring-logging.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solr/solr-ref-guide/src/configuring-logging.adoc b/solr/solr-ref-guide/src/configuring-logging.adoc index de1dc95aea7..e14fb8851ac 100644 --- a/solr/solr-ref-guide/src/configuring-logging.adoc +++ b/solr/solr-ref-guide/src/configuring-logging.adoc @@ -153,7 +153,7 @@ See the section on <.request.log`, rolled over daily. By default, 3 days worth of request logs are retained. +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/.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`. From 360aec62615c316924d48135be8cc6324f214d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 13:55:06 +0100 Subject: [PATCH 10/11] Add to major-changes-in-solr-9.adoc --- solr/solr-ref-guide/src/major-changes-in-solr-9.adoc | 1 + 1 file changed, 1 insertion(+) 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.adoc index 1033fb02e7f..918e4329884 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,7 @@ 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 on NCSA format is now enabled by default, with a retention of 3 days worth of logs. == New Features & Enhancements From 96653dc6da1aa21a25cef0b6a244e4d9857404b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 18 Jan 2022 13:56:57 +0100 Subject: [PATCH 11/11] Tweak major changes text --- solr/solr-ref-guide/src/major-changes-in-solr-9.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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.adoc index 918e4329884..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,7 +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 on NCSA format is now enabled by default, with a retention of 3 days worth of logs. +* 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 & Enhancements