Skip to content

JCU: Solr log rotating config (port from customer/vsb-tuo) - #1418

Merged
milanmajchrak merged 1 commit into
customer/jcufrom
jcu/solr-log-rotating
Aug 24, 2026
Merged

JCU: Solr log rotating config (port from customer/vsb-tuo)#1418
milanmajchrak merged 1 commit into
customer/jcufrom
jcu/solr-log-rotating

Conversation

@MatusBeke

Copy link
Copy Markdown
Collaborator

Ports the Solr logging config from customer/vsb-tuo to customer/jcu.

What was missing

The DSpace-side log rotation (gzip on rollover) is already on customer/jculog4j2.xml, log4j2-cli.xml, log4j2-handle-plugin.xml and log4j2-container.xml all use .gz filePatterns.

The Solr side was missing entirely: scripts/log4j2.solr.xml did not exist on this branch and the dspace-solr image 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 on customer/vsb-tuo (blob 79e8b3f), i.e. including the gzip change from VSB-TUO/Cherrypick log rotating #1224:
    • solr.log and solr_slow_requests.log roll at 32 MB, max 10 archives
    • rotated files are gzipped (solr.log.%i.gz)
    • STDOUT appender is limited to WARN and above; full detail goes to MainLogFile
  • dspace/src/main/docker/dspace-solr/DockerfileCOPY scripts/log4j2.solr.xml /var/solr/log4j2.xml, same placement as on customer/vsb-tuo.

init-var-solr only seeds /var/solr/log4j2.xml when it does not exist, so the baked-in file wins.

Note (pre-existing, not introduced here)

docker-compose.yml builds dspacesolr with context: ./dspace/src/main/docker/dspace-solr/, so a local docker compose up --build dspacesolr cannot resolve COPY scripts/.... The CI build is fine — .github/workflows/docker.yml uses reusable-docker-build.yml, whose dockerfile_context defaults to . (repo root), and that is what produces the deployed dataquest/dspace-solr image.

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 a solrlogs additional 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

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.xml in dspace/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.

Comment thread scripts/log4j2.solr.xml
Comment thread scripts/log4j2.solr.xml
Comment thread dspace/src/main/docker/dspace-solr/Dockerfile
@milanmajchrak
milanmajchrak merged commit eda7f25 into customer/jcu Aug 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants