Package zeroecho.logging
package zeroecho.logging
Provides lightweight logging utilities and configuration helpers for Java
Util Logging (JUL).
Overview
This package complements the standard java.util.logging framework
with tools for streamlined configuration and more compact log output. It is
designed for applications that prefer JUL over third-party logging frameworks
but still require concise, production-ready log formatting.
Components
ClasspathJulConfig– loads ajul.propertiesconfiguration file from the application classpath and applies it to the globalLogManager. This allows declarative setup of handlers, levels, and formatters without manual bootstrap code.CompactOneLineFormatter– a formatter that produces single-line log records with timestamps, thread names, class/method context, and optional exception summaries. The output is compact enough for terminals and log aggregation systems, while still preserving diagnostic detail.
Design goals
- Simplicity – avoid external dependencies and keep JUL setup minimal.
- Compactness – formatters collapse whitespace and abbreviate fully qualified class names to keep logs dense but readable.
- Safety – exception details are reduced to single-line summaries, preventing multi-line stack traces from overwhelming logs in production.
Usage example
// Automatically loads jul.properties from the classpath
new ClasspathJulConfig();
Logger logger = Logger.getLogger("demo");
logger.info("Hello world");
- Since:
- 1.0
-
ClassesClassDescriptionConfigures
java.util.logging(JUL) from ajul.propertiesresource on the classpath.A compact single-lineFormatterfor JUL log records.