Repository navigation
Support json as a value of LOG_CONSOLE_FORMAT / LOG_FILE_FORMAT for JSON log lines - #4393
Merged
Merged
Conversation
β¦G_TERMINAL_FORMAT
Selecting json writes one JSON object per line with Elastic Common Schema
field names. The JSON is built with PatternLayout and %enc{...}{JSON} since
Minecraft server jars do not include log4j-layout-template-json and their
launchers load Log4j in an isolated class loader.
Requires Minecraft 1.18.1 or newer (Log4j 2.17); older versions keep the
default text format with a warning.
Fixes itzg#3870
The pattern is stored unescaped and XML-escaped when it is read, instead of carrying " entities and shell quote workarounds inline.
itzg
approved these changes
Nov 14, 2026
gabrielcosi
pushed a commit
to gabrielcosi/home-ops
that referenced
this pull request
Nov 23, 2026
β¦ β 2026.11.1) (#1900) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/itzg/minecraft-server](https://github.com/itzg/docker-minecraft-server) | patch | `2026.11.0-java25` β `2026.11.1-java25` | --- ### Release Notes <details> <summary>itzg/docker-minecraft-server (ghcr.io/itzg/minecraft-server)</summary> ### [`v2026.11.1`](https://github.com/itzg/docker-minecraft-server/releases/tag/2026.11.1) [Compare Source](itzg/docker-minecraft-server@2026.11.0...2026.11.1) <!-- Release notes generated using configuration in .github/release.yml at 0699bd8497cb1e3c8e257fecd4320671194c6903 --> #### What's Changed ##### Enhancements - Support `json` as a value of `LOG_CONSOLE_FORMAT` / `LOG_FILE_FORMAT` for JSON log lines by [@​eliasehmann](https://github.com/eliasehmann) in [#​4393](itzg/docker-minecraft-server#4393) - Exclude client-only Smart Particles and You Must Know This Notice for CurseForge packs by [@​Wroud](https://github.com/Wroud) in [#​4396](itzg/docker-minecraft-server#4396) - Mitigate Java4Shell by disabling UseBASE64Intrinsics for Java 17 and newer versions by [@​itzg](https://github.com/itzg) in [#​4400](itzg/docker-minecraft-server#4400) - Add HANGAR_PROJECTS to download plugins from Hangar by [@​caunt](https://github.com/caunt) in [#​4392](itzg/docker-minecraft-server#4392) - Java4Shell is now fixed in base image by [@​itzg](https://github.com/itzg) in [#​4409](itzg/docker-minecraft-server#4409) ##### Documentation - build(deps): bump the patches group in /docs with 2 updates by [@​dependabot](https://github.com/dependabot)\[bot] in [#​4402](itzg/docker-minecraft-server#4402) - build(deps): bump pymdown-extensions from 12.3 to 13.1 in /docs by [@​dependabot](https://github.com/dependabot)\[bot] in [#​4403](itzg/docker-minecraft-server#4403) - docs: add Minecraft Server Manager (MSM) to related projects by [@​anefzaoui](https://github.com/anefzaoui) in [#​4407](itzg/docker-minecraft-server#4407) ##### Other Changes - Update dependency itzg/mc-image-helper to v1.76.2 by [@​renovate](https://github.com/renovate)\[bot] in [#​4386](itzg/docker-minecraft-server#4386) - build(deps): bump docker/login-action from 4.7.0 to 4.8.0 in the updates group by [@​dependabot](https://github.com/dependabot)\[bot] in [#​4387](itzg/docker-minecraft-server#4387) - build(deps): combine docs dependency updates by [@​itzg](https://github.com/itzg) in [#​4390](itzg/docker-minecraft-server#4390) - Update all non-major dependencies by [@​renovate](https://github.com/renovate)\[bot] in [#​4391](itzg/docker-minecraft-server#4391) - Update all non-major dependencies by [@​renovate](https://github.com/renovate)\[bot] in [#​4395](itzg/docker-minecraft-server#4395) - Update all non-major dependencies by [@​renovate](https://github.com/renovate)\[bot] in [#​4397](itzg/docker-minecraft-server#4397) - Update dependency itzg/mc-image-helper to v1.78.1 by [@​renovate](https://github.com/renovate)\[bot] in [#​4398](itzg/docker-minecraft-server#4398) - Parse .mc-health.env instead of sourcing it by [@​lbellows](https://github.com/lbellows) in [#​4399](itzg/docker-minecraft-server#4399) - Update dependency itzg/mc-image-helper to v1.78.2 by [@​renovate](https://github.com/renovate)\[bot] in [#​4401](itzg/docker-minecraft-server#4401) - Update all non-major dependencies by [@​renovate](https://github.com/renovate)\[bot] in [#​4410](itzg/docker-minecraft-server#4410) #### New Contributors - [@​eliasehmann](https://github.com/eliasehmann) made their first contribution in [#​4393](itzg/docker-minecraft-server#4393) - [@​anefzaoui](https://github.com/anefzaoui) made their first contribution in [#​4407](itzg/docker-minecraft-server#4407) **Full Changelog**: <itzg/docker-minecraft-server@2026.11.0...2026.11.1> </details> --- ### Configuration π **Schedule**: (in timezone Europe/Berlin) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) π¦ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. π **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Operator](https://github.com/mogenius/renovate-operator). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNTcuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjI1Ny41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.xcd.dev/gabrielcosi/home-ops/pulls/1900
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.
Fixes #3870
When the image generates the log4j2 configuration (
GENERATE_LOG4J2_CONFIG=true),LOG_CONSOLE_FORMAT,LOG_FILE_FORMATandLOG_TERMINAL_FORMATnow acceptjson. The server then writes one JSON object per line using Elastic Common Schema field names, the same names as Log4j'sEcsLayout.jsontemplate:{"@timestamp":"2026-11-12T13:57:46.895Z","ecs.version":"1.2.0","log.level":"INFO","message":"No existing world data, creating new world","process.thread.name":"Worker-Main-6","log.logger":"net.minecraft.server.Main"}error.stack_traceis added when an event carries an exception.Why not JsonTemplateLayout
None of the server jars I checked include
log4j-layout-template-json: vanilla 1.16.5, 1.18.2, 1.20.1 and 26.3, Paper 1.21.10, NeoForge 26.3 and the Fabric loader libraries. The image can't add it either, because the vanilla bundler and Paperclip load the server in a URLClassLoader whose parent is the platform class loader, so the JVM classpath isn't visible to Log4j. The JSON is therefore built with PatternLayout and%enc{...}{JSON}, which every Log4j bundled since Minecraft 1.18.1 (2.17+) supports. A top-level%ex{none}keeps Log4j 2.17/2.19 from appending a raw stack trace after the JSON.Behavior
jsonchanges only that output, sodocker logscan be JSON whilelogs/latest.logstays text.jsonis ignored.jsonthe generated log4j2.xml is unchanged.Testing
jq.jq. Vanilla 1.17.1 falls back to text with a warning. With the option off, the generated log4j2.xml is identical to the current image's.log4j-json.Lines that don't come from Log4j (the
[init]lines, the launcher's "Unpacking..." output, mc-server-runner) remain plain text, as noted in the docs.