Top Description Methods
io.opentelemetry.api.logs

public Interface LoggerBuilder

Known Direct Implementers
io.opentelemetry.api.logs.DefaultLoggerProvider.NoopLoggerBuilder

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.

Since
1.27.0

Method Summary

Modifier and TypeMethod and Description
public Logger

Returns:

a Logger instance configured with the provided options.
build
()

Gets or creates a Logger instance.

public LoggerBuilder

Returns:

this
setInstrumentationVersion
(String
The instrumentation scope version.
instrumentationScopeVersion
)

Sets the instrumentation scope version of the resulting Logger.

public LoggerBuilder

Returns:

this
setSchemaUrl
(String
The schema URL.
schemaUrl
)

Set the scope schema URL of the resulting Logger.

Method Detail

buildback to summary
public Logger build()

Gets or creates a Logger instance.

Returns:Logger

a Logger instance configured with the provided options.

setInstrumentationVersionback to summary
public LoggerBuilder setInstrumentationVersion(String instrumentationScopeVersion)

Sets the instrumentation scope version of the resulting Logger. Version is part of Logger identity.

Parameters
instrumentationScopeVersion:String

The instrumentation scope version.

Returns:LoggerBuilder

this

setSchemaUrlback to summary
public LoggerBuilder setSchemaUrl(String schemaUrl)

Set the scope schema URL of the resulting Logger. Schema URL is part of Logger identity.

Parameters
schemaUrl:String

The schema URL.

Returns:LoggerBuilder

this