Services

Logger

v1.0.0

Default LoggerInterface implementation. Writes structured JSON entries to meteorack_module_events with module slug, timestamp, and OTel trace context.

Methods

public function info(string $event, array $context = []): void

Log info-level event with automatic module slug prefix.

public function error(string $event, array $context = []): void

Log error-level event. Errors increment the crash counter if they occur during boot.

Example

logger.php
// Logs are scoped automatically:
$this->logger->info('cache.cleared', ['keys' => 15]);
// Stored as: { module: "my-module", event: "cache.cleared", ... }