The shared loggers and the locale-pinned timestamp
The shared loggers and the locale-pinned timestamp
Answer
private static final Logger requests = Logger.getLogger("requests"); private static final Logger errors = Logger.getLogger("errors"); private static final DateTimeFormatter STAMP = DateTimeFormatter.ofPattern("dd/MMM/yyyy:HH:mm:ss Z", Locale.US);
Two loggers for two purposes, both `static final` so every pooled handler shares one thread-safe instance. `Locale.US` is not decoration: `MMM` renders in the default locale, and a month name in any other language makes the log unparseable by the analyser.
Harold 4e ch9 §Logging; §A Full-Fledged HTTP Server