itzg / itzg/docker-minecraft-server

Add first-class JSON log output (Log4j2 JsonTemplateLayout) via env var

Open
#3,870 1 comment 1 reaction 0 assignees View on GitHub
enhancement help wanted
Dominant language
Shell
Stars
14.3k
Forks
1.9k
Avg merge
2d 10h
Merged PRs (30d)
31

Description

### Enhancement Type

Improve an existing feature

### Describe the enhancement

**Describe the problem / motivation**
Many log pipelines and docker observation tools work best with JSON in container stdout. Today the image primarily supports customizing PatternLayout via `LOG_CONSOLE_FORMAT` / `LOG_FILE_FORMAT`, which still produces unstructured text. ([docker-minecraft-server.readthedocs.io](https://docker-minecraft-server.readthedocs.io/en/latest/configuration/misc-options/))

**Proposed enhancement**
Add an opt-in way to switch console (and optionally file) logs to **JSON output** using Log4j2’s **JsonTemplateLayout**. ([logging.apache.org](https://logging.apache.org/log4j/2.x/manual/json-template-layout.html))

Suggested UX:

* `LOG_FORMAT=json` (or `LOG_LAYOUT=json-template`)
* `LOG_JSON_TEMPLATE=`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the configuration that handles LOG_CONSOLE_FORMAT and LOG_FILE_FORMAT, then review Log4j2 JsonTemplateLayout and the linked documentation. Done means an opt-in environment variable produces JSON console logs, with the proposed optional file-log and template behavior clarified and covered by appropriate validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java, shell
Domain
devops, observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.