SimpleSpanProcessor
in package
implements
SpanProcessorInterface
uses
LogsToLoggerTrait
Table of Contents
Interfaces
Properties
- $closed : bool
- $exportContext : ContextInterface
- $exporter : SpanExporterInterface
- $logger : LoggerInterface
- $queue : SplQueue<string|int, ContextInterface}>
- $running : bool
Methods
- __construct() : mixed
- forceFlush() : bool
- Export all ended spans to the configured Exporter that have not yet been exported.
- onEnd() : void
- onStart() : void
- shutdown() : bool
- Cleanup; after shutdown, calling onStart, onEnd, or forceFlush is invalid Returns `false` is the processor is already shutdown, otherwise `true`.
- logDebug() : void
- logError() : void
- logInfo() : void
- logNotice() : void
- logWarning() : void
- doLog() : void
- Logging is best effort: a failing logger must not break the code that is being observed.
- flush() : bool
- logger() : LoggerInterface
Properties
$closed
private
bool
$closed
= false
$exportContext
private
ContextInterface
$exportContext
$exporter read-only
private
SpanExporterInterface
$exporter
$logger read-only
private
LoggerInterface
$logger
= new ConfiguredLogger()
$queue
private
SplQueue<string|int, ContextInterface}>
$queue
$running
private
bool
$running
= false
Methods
__construct()
public
__construct(SpanExporterInterface $exporter[, LoggerInterface $logger = new ConfiguredLogger() ]) : mixed
Parameters
- $exporter : SpanExporterInterface
- $logger : LoggerInterface = new ConfiguredLogger()
forceFlush()
Export all ended spans to the configured Exporter that have not yet been exported.
public
forceFlush([CancellationInterface|null $cancellation = null ]) : bool
Returns true if the flush was successful, otherwise false.
Parameters
- $cancellation : CancellationInterface|null = null
Attributes
- #[Override]
Return values
boolonEnd()
public
onEnd(ReadableSpanInterface $span) : void
Parameters
- $span : ReadableSpanInterface
Attributes
- #[Override]
onStart()
public
onStart(ReadWriteSpanInterface $span, ContextInterface $parentContext) : void
Parameters
- $span : ReadWriteSpanInterface
- $parentContext : ContextInterface
Attributes
- #[Override]
shutdown()
Cleanup; after shutdown, calling onStart, onEnd, or forceFlush is invalid Returns `false` is the processor is already shutdown, otherwise `true`.
public
shutdown([CancellationInterface|null $cancellation = null ]) : bool
Parameters
- $cancellation : CancellationInterface|null = null
Attributes
- #[Override]
Return values
boollogDebug()
protected
logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logError()
protected
logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logInfo()
protected
logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logNotice()
protected
logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logWarning()
protected
logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
doLog()
Logging is best effort: a failing logger must not break the code that is being observed.
private
doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
- $level : string
- $message : string
- $context : array<string|int, mixed>
flush()
private
flush(Closure $task, string $taskName, bool $propagateResult, ContextInterface $context) : bool
Parameters
- $task : Closure
- $taskName : string
- $propagateResult : bool
- $context : ContextInterface
Return values
boollogger()
private
logger() : LoggerInterface
Attributes
- #[Override]