Interface LoggerBuilder


public interface LoggerBuilder
Builder class for creating Logger instances.

Loggers are identified by their scope name, version, and schema URL. These identifying fields, along with attributes, combine to form the instrumentation scope, which is attached to all log records produced by the Logger.

  • Method Details

    • setEventDomain

      LoggerBuilder setEventDomain(String eventDomain)
      Set the event domain of the resulting Logger.

      NOTE: Event domain is required to use Logger.eventBuilder(String).

      The event domain will be included in the event.domain attribute of every event produced by the resulting Logger.

      Parameters:
      eventDomain - The event domain, which acts as a namespace for event names. Within a particular event domain, event name defines a particular class or type of event.
      Returns:
      this
    • setSchemaUrl

      LoggerBuilder setSchemaUrl(String schemaUrl)
      Set the scope schema URL of the resulting Logger. Schema URL is part of Logger identity.
      Parameters:
      schemaUrl - The schema URL.
      Returns:
      this
    • setInstrumentationVersion

      LoggerBuilder setInstrumentationVersion(String instrumentationScopeVersion)
      Sets the instrumentation scope version of the resulting Logger. Version is part of Logger identity.
      Parameters:
      instrumentationScopeVersion - The instrumentation scope version.
      Returns:
      this
    • build

      Logger build()
      Gets or creates a Logger instance.
      Returns:
      a Logger instance configured with the provided options.