There are 4 updates, 1 comment.
 
 
XWiki Docker images / cid:jira-generated-image-avatar-6cf3bb4f-eb01-4de5-9b9a-76cdd288a2ec XDOCKER-78 Closed

XWiki logs do not appear in a catalina.out log file

 
View issue   ยท   Add comment
 

4 updates

 
cid:jira-generated-image-avatar-b9dd1790-800b-4cb1-8597-3918ef575629 Changes by Vincent Massol on 18/Jul/26 22:07
 
Documentation in Release Notes: https://www.xwiki.org/xwiki/bin/view/ReleaseNotes/Data/XWiki/18.6.0RC1/#HForAdmins
Documentation: https://github.com/xwiki/xwiki-docker/blob/master/README.md#logs && https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Logging#HMainLogs
Resolution: Fixed
Status: Open Closed
 
 

1 comment

 
cid:jira-generated-image-avatar-b9dd1790-800b-4cb1-8597-3918ef575629 Vincent Massol on 18/Jul/26 22:03
 

Fixed in the docker-xwiki packaging.

Root cause

The XWiki WAR's default logback.xml logs to the console only. In the Docker packaging that means the logs are only visible through docker logs (or the console that started the container) and are never written to a file inside the container, so they cannot be read from within XWiki (e.g. by the Admin Tools application's log viewer).

What was done

XWiki logs are now written to both:
* the console, so that docker logs keeps working (the Docker way), and
* a rotating file in the permanent directory, at /usr/local/xwiki/data/logs/xwiki.log. Since the permanent directory is mapped to a volume, these logs persist across container recreations and can be read from within XWiki.

This is implemented by augmenting the WAR's own logback.xml at image build time (in the Dockerfile, right after the WAR is unzipped) with a RollingFileAppender, rather than shipping a full copy of the file. This way we never drift from the version-specific logger levels the WAR defines. The appender definition is injected right after the opening }} tag and its reference right after the existing {{stdout one (via sed's r command on stable anchors, avoiding a fragile in-place edit).

Rotation policy

Aligned with the XWiki Standalone (jetty/hsqldb) packaging's console-capture.xml (daily rotation on UTC day boundaries, 90 days of history), with, in addition, container-safety extras so the volume cannot fill up:
* daily rotation and a 100 MB per-file size cap
* archives gzip-compressed, named xwiki-..log.gz
* 90 days of history, total size capped at 3 GB

Note on performance: negligible at the default WARN level; the console side already persists to disk via Docker's logging driver, and the permanent directory is normally a fast named volume. The appender is synchronous (no log loss).

The README.md was updated with a new "Logs" section documenting this.

Follow-ups (separate)