OpenTelemetry PHP

Logger
in package
implements LoggerInterface uses LogsMessagesTrait

Note that this logger class is deliberately NOT psr-3 compatible, per spec: "Note: this document defines a log backend API. The API is not intended to be called by application developers directly."

Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md

Table of Contents

Interfaces

LoggerInterface

Properties

$config  : LoggerConfig
$loggerSharedState  : LoggerSharedState
$scope  : InstrumentationScopeInterface

Methods

emit()  : void
This method should only be used when implementing a `log appender`
isEnabled()  : bool
Determine if the logger is enabled. Logs bridge API authors SHOULD call this method each time they are about to generate a LogRecord, to avoid performing computationally expensive work.
updateConfig()  : void
logDebug()  : void
logError()  : void
logInfo()  : void
logNotice()  : void
logWarning()  : void
doLog()  : void
shouldLog()  : bool

Properties

Methods

emit()

This method should only be used when implementing a `log appender`

public emit(LogRecord $logRecord) : void
Parameters
$logRecord : LogRecord

isEnabled()

Determine if the logger is enabled. Logs bridge API authors SHOULD call this method each time they are about to generate a LogRecord, to avoid performing computationally expensive work.

public isEnabled() : bool
Return values
bool

logDebug()

protected static logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logError()

protected static logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logInfo()

protected static logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logNotice()

protected static logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logWarning()

protected static logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

doLog()

private static doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
$level : string
$message : string
$context : array<string|int, mixed>

shouldLog()

private static shouldLog(string $level) : bool
Parameters
$level : string
Return values
bool

        
On this page

Search results