XWiki Logs in the Docker Image
Reference
The XWiki Docker image writes XWiki's logs to the container console, so that docker logs keeps working, and XWiki 17.10.11+, 18.4.3+, 18.6.0+ also to a rotating file in the permanent directory, so that they survive the recreation of the container.
Log Destinations
| Log | Location | How to Read It | Survives Container Removal |
|---|---|---|---|
| XWiki, through Logback | The container console | docker logs, or docker compose logs | No. The console output is kept by the Docker logging driver only for as long as the container exists. |
| XWiki 17.10.11+, 18.4.3+, 18.6.0+ XWiki, through Logback | The logs/xwiki.log file of the permanent directory, at /usr/local/xwiki/data/logs/xwiki.log | docker exec, or directly on the host when the permanent directory is bind-mounted to a host directory | Yes. The permanent directory is mapped to a volume. |
| Tomcat, through JULI | The container console, and also the dated catalina. and localhost. files of /usr/local/tomcat/logs/ | docker logs, or docker exec | No. That directory is not mapped to a volume. |
| The Tomcat access log | The dated localhost_access_log. files of /usr/local/tomcat/logs/ | docker exec | No. That directory is not mapped to a volume. |
Only XWiki's own log is written to a file that persists. Map /usr/local/tomcat/logs to a volume of your own if you need Tomcat's log files or its access log to persist too.
Reading the Console Output
Follow the console output of a running container, as follows:
docker logs -f xwiki-mysql-tomcat-webWith Docker Compose, use the name of the service rather than the name of the container, as follows:
docker compose logs -f webThe XWiki Log File
XWiki 17.10.11+, 18.4.3+, 18.6.0+
The xwiki.log file of the permanent directory rotates as follows:
| Setting | Value |
|---|---|
| File | /usr/local/xwiki/data/logs/xwiki.log |
| Rotation | Once a day, on UTC day boundaries, and also whenever the current file reaches 100MB |
| Archived files | Compressed with gzip and named after the day they cover, followed by an index for each 100MB file of that day, for example xwiki-2026-07-18.0.log.gz |
| History | At most 90 days of archives |
| Total size | At most 3GB of archives. The oldest archives are deleted first. |
| Line format | %d [%t] %-5p %-30.30c{2} - %m %n |
Read the file from inside the container, as follows:
docker exec xwiki-mysql-tomcat-web tail -f /usr/local/xwiki/data/logs/xwiki.logWhen the permanent directory is bind-mounted to a directory of the host, read the file directly on the host, without going through Docker, as follows:
tail -f /my/path/xwiki/logs/xwiki.logThe rolling file appender is named filelog, and the image adds it to the Logback configuration of the XWiki WAR when the image is built. A logback.xml of your own replaces that whole file, so start from the one that is inside the container rather than from scratch, otherwise XWiki stops writing a log file:
docker cp xwiki-mysql-tomcat-web:/usr/local/tomcat/webapps/ROOT/WEB-INF/classes/logback.xml .Changing the Logging Configuration
- To change log levels on a running instance, use the Logging Application of the wiki administration, as described in Logging. Such changes apply immediately, but they are lost when the container is restarted.
- To change the logging configuration permanently, including the log levels, the rotation policy and the destinations, override the logback.xml configuration file as described in Custom Configuration Files in Docker.
FAQ
Why is there no catalina.out file?
The image starts Tomcat in the foreground, and Tomcat then writes to the console instead of to a catalina.out file. Read that output with docker logs, and read XWiki's own log in /usr/local/xwiki/data/logs/xwiki.log.
Do the logs survive stopping and removing the containers?
The xwiki.log file and its archives do, because the permanent directory is mapped to a volume. The console output and the Tomcat log files of /usr/local/tomcat/logs do not: they are removed together with the container.
How do I change the log level of a single category?
Use the Logging Application of the wiki administration on a running instance, or declare the logger in a logback.xml file of your own for a change that survives restarts.
How do I stop XWiki from writing a log file?
Override logback.xml with a version that does not reference the filelog appender. XWiki then logs to the console only.