Package io.opentelemetry.api.logs
Interface LoggerBuilder
public interface LoggerBuilder
Builder class for creating
Logger instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Gets or creates aLoggerinstance.setEventDomain(String eventDomain) Set the event domain of the resultingLogger.setInstrumentationVersion(String instrumentationScopeVersion) Assign a version to the instrumentation scope that is using the resultingLogger.setSchemaUrl(String schemaUrl) Assign an OpenTelemetry schema URL to the resultingLogger.
-
Method Details
-
setEventDomain
Set the event domain of the resultingLogger.NOTE: Event domain is required to use
Logger.eventBuilder(String).The event domain will be included in the
event.domainattribute of every event produced by the resultingLogger.- 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
Assign an OpenTelemetry schema URL to the resultingLogger.- Parameters:
schemaUrl- the URL of the OpenTelemetry schema being used by this instrumentation scope- Returns:
- this
-
setInstrumentationVersion
Assign a version to the instrumentation scope that is using the resultingLogger.- Parameters:
instrumentationScopeVersion- the version of the instrumentation scope- Returns:
- this
-
build
Logger build()Gets or creates aLoggerinstance.- Returns:
- a logger instance configured with the provided options
-