JCU: Solr log rotating config (port from customer/vsb-tuo) - #1418
Merged
Conversation
Adds scripts/log4j2.solr.xml (byte-identical to customer/vsb-tuo) and copies it to /var/solr/log4j2.xml in the dspace-solr image. - solr.log / solr_slow_requests.log rotate at 32 MB, max 10 archives - rotated files are gzipped (.gz filePattern), same as PR #1224 - STDOUT only logs WARN and above; everything else goes to MainLogFile The DSpace-side log4j2 configs on this branch already use .gz rollover, so only the Solr part was missing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Ports Solr-side Log4j2 configuration into the dspace-solr container so Solr logs rotate and gzip archives consistently with the DSpace-side logging setup on customer/jcu.
Changes:
- Add a new Solr Log4j2 configuration (
scripts/log4j2.solr.xml) with rolling + gzip (.gz) patterns for main + slow-request logs. - Bake that config into the Solr image by copying it to
/var/solr/log4j2.xmlindspace/src/main/docker/dspace-solr/Dockerfile.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/log4j2.solr.xml | New Solr Log4j2 config enabling size-based rollover and gzip archives; limits console output to WARN+. |
| dspace/src/main/docker/dspace-solr/Dockerfile | Copies the new Solr Log4j2 config into the built image at /var/solr/log4j2.xml. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the Solr logging config from
customer/vsb-tuotocustomer/jcu.What was missing
The DSpace-side log rotation (gzip on rollover) is already on
customer/jcu—log4j2.xml,log4j2-cli.xml,log4j2-handle-plugin.xmlandlog4j2-container.xmlall use.gzfilePatterns.The Solr side was missing entirely:
scripts/log4j2.solr.xmldid not exist on this branch and thedspace-solrimage did not override Solr's default log config, so Solr logs neither rotated the way we want nor got gzipped.Changes
scripts/log4j2.solr.xml(new) — byte-identical to the file oncustomer/vsb-tuo(blob79e8b3f), i.e. including the gzip change from VSB-TUO/Cherrypick log rotating #1224:solr.logandsolr_slow_requests.logroll at 32 MB, max 10 archivessolr.log.%i.gz)STDOUTappender is limited toWARNand above; full detail goes toMainLogFiledspace/src/main/docker/dspace-solr/Dockerfile—COPY scripts/log4j2.solr.xml /var/solr/log4j2.xml, same placement as oncustomer/vsb-tuo.init-var-solronly seeds/var/solr/log4j2.xmlwhen it does not exist, so the baked-in file wins.Note (pre-existing, not introduced here)
docker-compose.ymlbuildsdspacesolrwithcontext: ./dspace/src/main/docker/dspace-solr/, so a localdocker compose up --build dspacesolrcannot resolveCOPY scripts/.... The CI build is fine —.github/workflows/docker.ymlusesreusable-docker-build.yml, whosedockerfile_contextdefaults to.(repo root), and that is what produces the deployeddataquest/dspace-solrimage.This is exactly the same situation as on
customer/vsb-tuo, so this PR keeps the two branches consistent rather than fixing it here. Happy to add asolrlogsadditional build context (or move the file next to the Dockerfile) in a follow-up if we want local compose builds to work too.🤖 Generated with Claude Code