ConsoleExporter
in package
implements
LogRecordExporterInterface
Writes log records 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
Table of Contents
Interfaces
Properties
Methods
- __construct() : mixed
- export() : FutureInterface
- forceFlush() : bool
- shutdown() : bool
- convertInstrumentationScope() : array<string|int, mixed>
- convertLogRecord() : array<string|int, mixed>
- convertResource() : array<string|int, mixed>
- scopeKey() : string
Properties
$transport read-only
private
TransportInterface
$transport
Methods
__construct()
public
__construct(TransportInterface $transport) : mixed
Parameters
- $transport : TransportInterface
export()
public
export(iterable<mixed, ReadableLogRecord> $batch[, CancellationInterface|null $cancellation = null ]) : FutureInterface
Parameters
- $batch : iterable<mixed, ReadableLogRecord>
- $cancellation : CancellationInterface|null = null
Attributes
- #[Override]
Return values
FutureInterfaceforceFlush()
public
forceFlush([CancellationInterface|null $cancellation = null ]) : bool
Parameters
- $cancellation : CancellationInterface|null = null
Attributes
- #[Override]
Return values
boolshutdown()
public
shutdown([CancellationInterface|null $cancellation = null ]) : bool
Parameters
- $cancellation : CancellationInterface|null = null
Attributes
- #[Override]
Return values
boolconvertInstrumentationScope()
private
convertInstrumentationScope(InstrumentationScopeInterface $scope) : array<string|int, mixed>
Parameters
- $scope : InstrumentationScopeInterface
Return values
array<string|int, mixed>convertLogRecord()
private
convertLogRecord(ReadableLogRecord $record) : array<string|int, mixed>
Parameters
- $record : ReadableLogRecord
Return values
array<string|int, mixed>convertResource()
private
convertResource(ResourceInfo $resource) : array<string|int, mixed>
Parameters
- $resource : ResourceInfo
Return values
array<string|int, mixed>scopeKey()
private
scopeKey(InstrumentationScopeInterface $scope) : string
Parameters
- $scope : InstrumentationScopeInterface