Class NtfyJulAutoHandler

java.lang.Object
java.util.logging.Handler
io.github.pimak.ntfy.jul.NtfyJulAutoHandler

public final class NtfyJulAutoHandler extends Handler
Declarative zero-code entry point: name this class in a JUL logging.properties —

 handlers = java.util.logging.ConsoleHandler, io.github.pimak.ntfy.jul.NtfyJulAutoHandler
 
— and LogManager instantiates it reflectively at logging init (the same mechanism Tomcat's conf/logging.properties uses). Configuration comes from the ambient environment via JulAmbientConfig (-Dntfy.* > NTFY_* > classpath ntfy.properties), not from LogManager properties, so the keys are identical across every adapter in the family.

Composes rather than extends NtfyJulHandler: when the environment does not configure ntfy (or the classpath-endpoint guard refuses), the delegate is absent and this handler is a permanent no-op — the constructor must never throw, because LogManager would report it as a logging-configuration error on every startup.

  • Constructor Details

    • NtfyJulAutoHandler

      public NtfyJulAutoHandler()
      Invoked reflectively by LogManager; also usable directly. Never throws.
  • Method Details