ntfy-logging¶
ntfy notifications for the JVM: a framework-neutral engine with zero-code adapters for
java.util.logging, Logback, Spring Boot and Micronaut, a one-line Log4j2 appender, a native-ready
Quarkus extension, and a plain programmatic client.
Publish your application's ERROR-level log events as ntfy push notifications — and, if you opt in, WARN-level ones to a topic of their own. The engine is:
- storm-resistant — rate-limited with a count-never-lost suppressed-count digest, so a burst of errors collapses into one follow-up notification instead of flooding your topic;
- loop-safe — it never logs its own diagnostics back through the logging pipeline it publishes from, so a failure inside the notifier can never trigger itself;
- non-blocking by default — delivery is offloaded to a bounded queue drained by a daemon worker
(the first-class alternative to hand-wrapping an
AsyncAppender), so a slow or unreachable ntfy server never back-pressures your application threads during an error storm (async=falserestores synchronous delivery); - early — the JUL, Logback, Log4j2 and Quarkus adapters install through the logging framework
itself, so alerting is live before your Spring
ApplicationContext(or any DI container) exists — exactly the startup window where early fatal errors are otherwise invisible; - verifiable at boot — an opt-in
startup-pingself-test makes one real round-trip when the engine starts and reports a clear diagnostic ("the token may be revoked or expired", "url must be the base url with the topic NOT appended"), so a broken alerting config is found at deploy time instead of when the first real error silently fails to deliver; - GraalVM-native ready — the Quarkus extension builds its HTTP client at runtime-init, and
ntfy-coreships native-image metadata for hand-rolled native builds.
Pick your stack¶
Each library has its own guide with the dependency snippet, the Maven Central link, and the base config to get error alerts publishing:
| Guide | Artifact | The 30-second version |
|---|---|---|
| Spring Boot | ntfy-spring-boot-starter |
Add the starter, set ntfy.url/ntfy.topic in application.yml — error logs auto-publish; @Autowired NtfyClient for manual ones. |
| Quarkus | ntfy-quarkus-runtime |
Add the extension, set quarkus.ntfy.url/.topic — error logs auto-publish (native-ready); @Inject NtfyClient for manual ones. |
| Micronaut | ntfy-micronaut |
Add the module, set ntfy.url/ntfy.topic in application.yml — error logs auto-publish on the Logback root logger; @Inject NtfyClient for manual ones. |
| Plain Logback | ntfy-logback |
Add the appender, set NTFY_URL/NTFY_TOPIC — zero-code auto-install, or wire it explicitly in logback.xml. |
| Plain Log4j2 | ntfy-log4j2 |
Add the appender, set NTFY_URL/NTFY_TOPIC — declare <Ntfy .../> in log4j2.xml, or NtfyLog4j2Installer.install() in main. |
| java.util.logging | ntfy-jul |
Add the handler, set NTFY_URL/NTFY_TOPIC — declare it in logging.properties, or NtfyJulInstaller.install() in main. |
| Core | ntfy-core |
Build a NtfyConfig, drive NtfyClient yourself from any JVM app. |
Each module pulls ntfy-core transitively — you only ever declare the one that matches your stack.
Everything beyond the base config — the full key reference,
authentication, alert behavior,
level routing, filtering, MDC context,
observability, troubleshooting,
compatibility and the BOM — is shared across all seven
and listed in the sidebar.
API documentation¶
The aggregated Javadoc for every published module is part of this site, versioned alongside it:
Runnable examples¶
Every adapter has a small, realistic example application, and the guides above embed their real configuration files directly. They are not illustrations: their integration tests boot the example apps against a loopback ntfy stand-in in CI — covering the base alert path, the synchronous-vs- asynchronous delivery difference, and the clean-shutdown digest flush — so the examples on this site can never drift from the code.