mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-11-19 05:55:20 +00:00
Support json as a value of LOG_CONSOLE_FORMAT / LOG_FILE_FORMAT for JSON log lines (#4393)
This commit is contained in:
1 parent
58fa0ad96a
commit
30b26426f4
6 files changed
+73
-3
No files matched your search
@@ -0,0 +1,11 @@
|
||||
services:
|
||||
mc:
|
||||
restart: "no"
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
SETUP_ONLY: "TRUE"
|
||||
GENERATE_LOG4J2_CONFIG: "true"
|
||||
LOG_CONSOLE_FORMAT: json
|
||||
volumes:
|
||||
- ./data:/data
|
||||
@@ -0,0 +1,5 @@
|
||||
mc-image-helper assert fileExists /data/log4j2.xml
|
||||
# console appender uses the JSON pattern
|
||||
grep -A1 '<Console name="SysOut"' /data/log4j2.xml | grep -q '"ecs.version"'
|
||||
# file appender keeps the default text pattern
|
||||
grep -A1 '<RollingRandomAccessFile name="File"' /data/log4j2.xml | grep -qF 'pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n"'
|
||||
Reference in new issue
Block a user