Interface Logger

All Superinterfaces:
JsonLogger
All Known Implementing Classes:
AbstractLogger, ConsoleLogger, LoggerMock, RemoteLogger, StringLogger

public interface Logger extends JsonLogger
Interface to generate logging messages.
  • Method Details

    • event

      LogMessage event(String name)
      Creates a logging event using the loggers level.
      Parameters:
      name - the name of the event.
      Returns:
      a LogMessage with a generated event, level, timestamp and context.
    • event

      LogMessage event(String name, LogLevel level)
      Creates a logging event using a provided logger level.
      Parameters:
      name - the name of the event.
      level - the level.
      Returns:
      a LogMessage with a generated event, level, timestamp and context.
    • onAlreadyInitialized

      void onAlreadyInitialized()
      Emit when multiple attempts to initialize singleton.
    • onFileLoadError

      void onFileLoadError(String fileName)
      Emit when failing to load specified fileName;
      Parameters:
      fileName - handler of the file that failed to load
    • onMetricsSnapshot

      void onMetricsSnapshot(io.vertx.core.json.JsonObject metrics)
      Send METRICS_ENABLED to the logger.
      Parameters:
      metrics - a json object containing metrics data to be published
    • onHandlerMissing

      void onHandlerMissing(String target, String route)
      Throw when a requested handler was not found.
      Parameters:
      target - the target handler
      route - the route of the handler
    • onFileLoaded

      void onFileLoaded(String path)
      Emit when a file has been loaded from the file-system.
      Parameters:
      path - a path to the loaded file.
    • onConfigurationDefaultsLoaded

      void onConfigurationDefaultsLoaded(String path, Class<?> clazz)
      Emit when a configuration was not found on disk and its defaults was loaded from memory.
      Parameters:
      path - the path to the configurable that was not found.
      clazz - the class of the configurable.
    • onInvalidConfigurable

      void onInvalidConfigurable(Class<?> clazz)
      Throw when a configuration was not found and the attempt to instantiate default configuration from the given class has error.
      Parameters:
      clazz - a class that is not of Configurable type.
    • onCacheCleared

      void onCacheCleared(String component)
      Emit when the cache of a component has been cleared.
      Parameters:
      component - the handler of the component.
    • onFileSaved

      void onFileSaved(String component, String path)
      Emit when a file has been saved to file.
      Parameters:
      component - the component that saved the file.
      path - to the saved file.
    • onFileSaveError

      void onFileSaveError(String fileName)
      Emit when error to save file.
      Parameters:
      fileName - handler of the entity that failed saving.
    • onError

      void onError(Throwable cause)
      Log general errors.
      Parameters:
      cause - the cause for throw.
    • onTimerSourceChanged

      void onTimerSourceChanged(String name, int initial, int interval)
      Emit when the interval of a periodic timer has changed.
      Parameters:
      name - handler of the timer that changed interval
      initial - the previous value of the interval
      interval - the new interval of the timer
    • onSecurityDependencyMissing

      void onSecurityDependencyMissing(String target, String identifier)
      Emit when a property in the security configuration is misconfigured.
      Parameters:
      target - the handler of the target that is missing the requested property identifier.
      identifier - the secret that was requested
    • onServiceStarted

      void onServiceStarted(CoreService service)
      Emit when a new server has started.
      Parameters:
      service - the service that was started
    • onServiceStopped

      void onServiceStopped(CoreService service)
      Emit when a server has stopped.
      Parameters:
      service - the service that was stopped
    • onServiceFailed

      void onServiceFailed(Throwable cause)
      Parameters:
      cause - the reason why the name has failed.
    • onListenerStarted

      void onListenerStarted(CoreListener listener)
      called when a listener is started.
      Parameters:
      listener - the listener that was started
    • onListenerStopped

      void onListenerStopped(CoreListener listener)
      called when a listener is stopped.
      Parameters:
      listener - the listener that was stopped
    • setMetadataValue

      Logger setMetadataValue(String key, Supplier<String> value)
      Sets a metadata value on the logger.
      Parameters:
      key - the key to put the metadata value in.
      value - a supplier invoked when an event is created.
      Returns:
      fluent.
    • setMetadata

      Logger setMetadata(String name, Supplier<io.vertx.core.json.JsonObject> value)
      Sets a metadata value on the logger.
      Parameters:
      name - a supplier to a metadata object that will be merged into the root node when an event is created..
      value - the dynamic metadata to add to log events.
      Returns:
      fluent.
    • removeMetadata

      Logger removeMetadata(String nameOrKey)
      Parameters:
      nameOrKey - removes metadata with a matching name or key.
      Returns:
      fluent.
    • close

      void close()
      Shuts down the logger instance, frees any resources such as files or thread pools.
    • log

      Logger log(String line)
      Parameters:
      line - the text line to be logged.
      Returns:
      fluent
    • log

      Logger log(String line, LogLevel level)
      Parameters:
      line - the text line to be logged.
      level - the logging level to log with.
      Returns:
      fluent