Skip to content

Commit 95ee707

Browse files
committed
SOLR-14142 Enable jetty's request log by default (#536)
(cherry picked from commit 1d761d2)
1 parent 8c4146e commit 95ee707

File tree

9 files changed

+19
-9
lines changed

9 files changed

+19
-9
lines changed

Diff for: solr/CHANGES.txt

+3
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ Other Changes
457457
* SOLR-14858: Add the server WEB-INF/lib directory to the classpath for the solr-exporter script. Will allow the script
458458
to work when the dist/solrj-lib jars are missing in the Docker image. (Houston Putman)
459459

460+
* SOLR-14142: Jetty's RequestLog is enabled by default. If you don't want these logs, you can disable
461+
via SOLR_REQUESTLOG_ENABLED=false. (rmuir, janhoy)
462+
460463
* SOLR-15924: Remove lucene-libs from contrib module packaging. The lucene libraries will be included in lib/ with all other dependencies. (Houston Putman)
461464

462465
Bug Fixes

Diff for: solr/bin/solr

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ else
270270
fi
271271

272272
# Requestlog options
273-
if [ "$SOLR_REQUESTLOG_ENABLED" == "true" ]; then
273+
if [ "${SOLR_REQUESTLOG_ENABLED:-true}" == "true" ]; then
274274
SOLR_JETTY_CONFIG+=("--module=requestlog")
275275
fi
276276

Diff for: solr/bin/solr.cmd

+3
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ IF "%SOLR_SSL_ENABLED%"=="true" (
150150
)
151151

152152
REM Requestlog options
153+
IF NOT DEFINED SOLR_REQUESTLOG_ENABLED (
154+
set SOLR_REQUESTLOG_ENABLED=true
155+
)
153156
IF "%SOLR_REQUESTLOG_ENABLED%"=="true" (
154157
set "SOLR_JETTY_CONFIG=!SOLR_JETTY_CONFIG! --module=requestlog"
155158
)

Diff for: solr/bin/solr.in.cmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ REM Location where Solr should write logs to. Absolute or relative to solr start
102102
REM set SOLR_LOGS_DIR=logs
103103

104104
REM Enables jetty request log for all requests
105-
REM set SOLR_REQUESTLOG_ENABLED=false
105+
REM set SOLR_REQUESTLOG_ENABLED=true
106106

107107
REM Sets the port Solr binds to, default is 8983
108108
REM set SOLR_PORT=8983

Diff for: solr/bin/solr.in.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
#SOLR_LOGS_DIR=logs
127127

128128
# Enables jetty request log for all requests
129-
#SOLR_REQUESTLOG_ENABLED=false
129+
#SOLR_REQUESTLOG_ENABLED=true
130130

131131
# Sets the port Solr binds to, default is 8983
132132
#SOLR_PORT=8983

Diff for: solr/server/etc/jetty-requestlog.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<New class="org.eclipse.jetty.server.AsyncRequestLogWriter">
3131
<Arg><Property name="solr.log.dir" default="logs"/>/yyyy_mm_dd.request.log</Arg>
3232
<Set name="filenameDateFormat">yyyy_MM_dd</Set>
33-
<Set name="retainDays">90</Set>
33+
<Set name="retainDays"><Property name="solr.log.requestlog.retaindays" default="3"/></Set>
3434
<Set name="append">true</Set>
3535
<Set name="timeZone">UTC</Set>
3636
</New>

Diff for: solr/solr-ref-guide/src/configuring-logging.adoc

+7
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,10 @@ The log file under which you can find all these queries is called `solr_slow_req
150150

151151
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`.
152152
See the section on <<common-query-parameters.adoc#logparamslist-parameter,logParamsList Parameter>> for more information.
153+
154+
== Request Logging
155+
156+
Every incoming HTTP(s) request is by default logged in the standard https://en.wikipedia.org/wiki/Common_Log_Format[`NCSA format`]
157+
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.
158+
You can disable request logging by setting `SOLR_REQUESTLOG_ENABLED=false` via environment variable or in `solr.in.sh`/`solr.in.cmd`.
159+
You can change the number of days to retain by system property `-Dsolr.log.requestlog.retaindays`.

Diff for: solr/solr-ref-guide/src/major-changes-in-solr-9.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ All the usages are replaced by BaseHttpSolrClient.RemoteSolrException and BaseHt
8585

8686
* SOLR-11623: Every request handler in Solr now implements PermissionNameProvider. Any custom or 3rd party request handler must also do this
8787

88+
* SOLR-14142: Jetty low level request-logging in NCSA format is now enabled by default, with a retention of 3 days worth of logs.
89+
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.
8890

8991
== New Features & Enhancements
9092

Diff for: solr/solr-ref-guide/src/securing-solr.adoc

-5
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ The authorization plugins that ship with Solr are:
8080
Audit logging will record an audit trail of incoming reqests to your cluster, such as users being denied access to admin APIs.
8181
Learn more about audit logging and how to implement an audit logger plugin in the section <<audit-logging.adoc#,Audit Logging>>.
8282

83-
== Request Logging
84-
85-
Solr can optionally log every incoming HTTP(s) request in the standard https://en.wikipedia.org/wiki/Common_Log_Format[`NCSA format`].
86-
You can enable request logging by setting `SOLR_REQUESTLOG_ENABLED=true` via environment variable or in `solr.in.sh`/`solr.in.cmd`.
87-
8883
== IP Access Control
8984

9085
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`.

0 commit comments

Comments
 (0)