Top Description Methods
io.opentelemetry.api.logs

public Interface LoggerProvider

Known Direct Implementers
io.opentelemetry.api.logs.DefaultLoggerProvider
Annotations
@ThreadSafe
Imports
io.opentelemetry.api.internal.IncubatingUtil, javax.annotation.concurrent.ThreadSafe

A registry for creating scoped Loggers. The name Provider is for consistency with other languages and it is NOT loaded using reflection.

The OpenTelemetry logs bridge API exists to enable bridging logs from other log frameworks (e.g. SLF4J, Log4j, JUL, Logback, etc) into OpenTelemetry and is NOT a replacement log API.

Since
1.27.0
See Also
Logger

Method Summary

Modifier and TypeMethod and Description
public default Logger

Returns:

a Logger instance.
get
(String
A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.
instrumentationScopeName
)

Gets or creates a named Logger instance.

public LoggerBuilder

Returns:

a LoggerBuilder instance.
loggerBuilder
(String
A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.
instrumentationScopeName
)

Creates a LoggerBuilder for a named Logger instance.

public static LoggerProvider
noop()

Returns a no-op LoggerProvider which provides Loggers which do not record or emit.

Method Detail

getback to summary
public default Logger get(String instrumentationScopeName)

Gets or creates a named Logger instance.

Parameters
instrumentationScopeName:String

A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.

Returns:Logger

a Logger instance.

loggerBuilderback to summary
public LoggerBuilder loggerBuilder(String instrumentationScopeName)

Creates a LoggerBuilder for a named Logger instance.

Parameters
instrumentationScopeName:String

A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.

Returns:LoggerBuilder

a LoggerBuilder instance.

noopback to summary
public static LoggerProvider noop()

Returns a no-op LoggerProvider which provides Loggers which do not record or emit.