OpenTelemetry PHP

ConsoleSpanExporter
in package
implements SpanExporterInterface uses UsesSpanConverterTrait, LogsMessagesTrait

Writes spans as human-readable JSON.

The output format is unspecified, is not OTLP and may change between releases. Use it for debugging and learning, not for parsing or as input to other tools.

Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.61.0/specification/trace/sdk_exporters/stdout.md

Table of Contents

Interfaces

SpanExporterInterface

Properties

$converter  : SpanConverterInterface|null
$transport  : TransportInterface

Methods

__construct()  : mixed
export()  : FutureInterface
forceFlush()  : bool
getSpanConverter()  : SpanConverterInterface
shutdown()  : bool
convertSpan()  : array<string|int, mixed>
logDebug()  : void
logError()  : void
logInfo()  : void
logNotice()  : void
logWarning()  : void
setSpanConverter()  : void
doLog()  : void
Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.
shouldLog()  : bool

Properties

Methods

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()

Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.

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