Package io.opentelemetry.api.logs
Interface LoggerProvider
@ThreadSafe
public interface LoggerProvider
A registry for creating scoped
Loggers. The name Provider is for consistency with
other languages and it is NOT loaded using reflection.
The OpenTelemetry logging API exists to enable the creation of log appenders, which bridge
logs from other log frameworks (e.g. SLF4J, Log4j, JUL, Logback, etc) into OpenTelemetry via
Logger.logRecordBuilder(). It is NOT a replacement log framework.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault LoggerGets or creates a named Logger instance.loggerBuilder(String instrumentationScopeName) Creates a LoggerBuilder for a named Logger instance.static LoggerProvidernoop()Returns a no-opLoggerProviderwhich provides Loggers which do not record or emit.
-
Method Details
-
get
Gets or creates a named Logger instance.- Parameters:
instrumentationScopeName- A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.- Returns:
- a Logger instance.
-
loggerBuilder
Creates a LoggerBuilder for a named Logger instance.- Parameters:
instrumentationScopeName- A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.- Returns:
- a LoggerBuilder instance.
-
noop
Returns a no-opLoggerProviderwhich provides Loggers which do not record or emit.
-