From 3461c9a1ef6f6061b95317b2543caae0bb1db5ac Mon Sep 17 00:00:00 2001 From: VirusAlex Date: Fri, 1 May 2026 11:54:22 +0300 Subject: [PATCH] fix(logback): drop literal '--' from comment, kills SAXParseException at startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #65 added a date to the logback.xml timestamp pattern with a long comment explaining why. The comment included the literal token 'kubectl logs --previous' to motivate the choice. XML forbids the '--' sequence inside comments — and rightly: it terminates the comment parser early and ambiguates with the closing '-->'. Effect at runtime: every JVM startup hit ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document. ... Caused by: org.xml.sax.SAXParseException; ... line 9 column 46; The string "--" is not permitted within comments. Logback then fell back to its default appender (no pattern, no level overrides) and the rest of the app proceeded with degraded logging. Reported by VirusAlex on the v0.4.1 docker-pull live test. Why it slipped through: ArchUnit doesn't validate XML; the only smoke test that exercises logback init was the Jetty-using server tests, which fail under our Windows CI env for unrelated loopback reasons. The CI build-and-package step also doesn't actually start the JVM with logback.xml on the classpath. Local mvn-test on JDK 25 didn't trip it because the test infra uses logback's default config. Fix: rewrite the comment as a one-liner that doesn't reference command- line flags. The kubernetes/GH-Actions framing was speculative scope creep anyway — NetCopy targets two trusted hosts on a LAN, not k8s. Verified locally: XML parses, java -jar netcopy.jar --version starts clean with no SAXParseException. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/main/resources/logback.xml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index e10c937..dc3b937 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,14 +1,8 @@ - + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{20} - %msg%n