Skip to content

Commit

Permalink
SOLR-14142 Enable jetty's request log by default (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
janhoy committed Jan 18, 2022
1 parent 402ff11 commit 1d761d2
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 9 deletions.
3 changes: 3 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion solr/bin/solr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions solr/bin/solr.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion solr/bin/solr.in.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion solr/bin/solr.in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion solr/server/etc/jetty-requestlog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 7 additions & 0 deletions solr/solr-ref-guide/src/configuring-logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<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`.
2 changes: 2 additions & 0 deletions solr/solr-ref-guide/src/major-changes-in-solr-9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 & Enhancements

Expand Down
5 changes: 0 additions & 5 deletions solr/solr-ref-guide/src/securing-solr.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 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`.
Expand Down

0 comments on commit 1d761d2

Please sign in to comment.