Interface LogRouter

All Superinterfaces:
AutoCloseable, LogLifecycle
All Known Subinterfaces:
LogRouter.RootRouter, LogRouter.Router
All Known Implementing Classes:
LogRouter.AbstractRouter

public sealed interface LogRouter extends LogLifecycle permits LogRouter.RootRouter, LogRouter.Router (not exhaustive)
Routes messages to a publisher by providing a LogRouter.Route from a logger name and level.
  • Method Details

    • route

      Finds a route.
      Parameters:
      loggerName - topic.
      level - level.
      Returns:
      route never null.
    • eventBuilder

      Creates (or reuses in the case of logging off) an event builder.
      Parameters:
      loggerName - logger name of the event.
      level - level that the event should be set to.
      Returns:
      builder.
      API Note
      using the builder is slightly slower and possibly more garbage (if the builder is not marked for escape analysis) than just manually checking LogRouter.Route.isEnabled() and constructing the event using the LogEvent static "of" factory methods.
    • global

      Global router which is always available.
      Returns:
      global root router.
    • ofLevel

      Creates a static router based on the level. Use a LevelResolver to resolve the level first.
      Parameters:
      logger - to publish events that are equal or above level.
      level - threshold of the router.
      Returns:
      immutable static router.
      API Note
      This method is for facades that do not have named level methods but are passed the level on every log method like the System Logger.