io.opentelemetry.api.logs.Logger Maven / Gradle / Ivy
Show all versions of polaris-all Show documentation
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.api.logs;
import javax.annotation.concurrent.ThreadSafe;
/**
* A {@link Logger} is the entry point into a log pipeline.
*
* Obtain a {@link #logRecordBuilder()}, add properties using the setters, and emit it via {@link
* LogRecordBuilder#emit()}.
*
*
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
*/
@ThreadSafe
public interface Logger {
/**
* Return a {@link LogRecordBuilder} to emit a log record.
*
*
IMPORTANT: this should be used to write appenders to bridge logs from logging
* frameworks (e.g. SLF4J, Log4j, JUL, Logback, etc). It is NOT a replacement for an
* application logging framework, and should not be used by application developers.
*
*
Build the log record using the {@link LogRecordBuilder} setters, and emit via {@link
* LogRecordBuilder#emit()}.
*/
LogRecordBuilder logRecordBuilder();
}