CustomLogger

interface CustomLogger

Interface for custom logger implementations. Provides both string-based and structured LogMessage-based logging.

Implementations receive every record the SDK produces. Per-record filtering (by level, format, or sampling) is the implementation's responsibility — typically inside the debug / trace / info / warn / error methods or in the downstream sink they delegate to. The SDK does not route records based on a per-logger level threshold.

The only knob the SDK consults on this interface before preparing expensive debug payloads is isDebugEnabled, and that is a performance hint — see its KDoc for details.

Properties

Link copied to clipboard
open val name: String

The name of this logger implementation.

Functions

Link copied to clipboard
open fun debug(logMessage: LogMessage)

Log a debug message with structured data.

open fun debug(message: String?)

Log a debug message with a string.

Link copied to clipboard
open fun error(logMessage: LogMessage)

Log an error message with structured data.

open fun error(message: String?)

Log an error message with a string.

Link copied to clipboard
open fun info(logMessage: LogMessage)

Log an info message with structured data.

open fun info(message: String?)

Log an info message with a string.

Link copied to clipboard

Hint to the SDK whether preparing expensive DEBUG payloads (message fingerprinting, UTF-8 truncation on publish/signal/subscribe) is worthwhile for this logger. Return false if the downstream sink is configured at INFO or higher; the SDK will skip that work unless another attached sink still needs DEBUG payloads.

Link copied to clipboard
open fun trace(logMessage: LogMessage)

Log a trace message with structured data.

open fun trace(message: String?)

Log a trace message with a string.

Link copied to clipboard
open fun warn(logMessage: LogMessage)

Log a warning message with structured data.

open fun warn(message: String?)

Log a warning message with a string.