LogExporter
Interface for exporting log records to external systems.
Exporters are responsible for transmitting log data to backends like OTLP collectors, logging services, or custom storage.
Example implementation:
final class OTLPLogExporter implements LogExporter
{
public function export(array $entries): bool
{
// Convert to OTLP format and send to collector
return $this->client->sendLogs($entries);
}
// ...
}
Methods
- export() : bool
- Export a batch of log entries.
- transports() : array<string|int, Transport>
- Get the transports used by this exporter.
Methods
export()
Export a batch of log entries.
public
export(array<string|int, LogEntry> $entries) : bool
Each log entry carries its own Resource and InstrumentationScope.
Parameters
- $entries : array<string|int, LogEntry>
-
The log entries to export
Return values
bool —True on success, false on failure
transports()
Get the transports used by this exporter.
public
transports() : array<string|int, Transport>
Return values
array<string|int, Transport> —Always returns at least one transport