logentries/logentries-monolog-handler
Monolog handler for sending Laravel/PHP application logs to Logentries (Rapid7). Adds a custom handler to forward log records over the network, enabling centralized log aggregation, search, and monitoring with minimal setup.
data.logentries.com ingestion endpoint. Reduces risk of API deprecation.monolog/handler-syslog, cloud-native tools) still preferred for long-term support, but this update slightly extends viability.data.logentries.com) is a breaking change if prior configs used api.logentries.com. Requires config updates.spl_object_hash deprecation).api.logentries.com? If so, config updates are mandatory.data.logentries.com support structured JSON logs (vs. legacy text format)?api.logentries.com? If so, this update is critical; if not, it’s a minor tweak.config/logging.php to use data.logentries.com:
'logentries' => [
'driver' => 'custom',
'via' => \App\Log\LogentriesHandler::class,
'url' => env('LOGENTRIES_URL', 'https://data.logentries.com/logs/...'), // Updated endpoint
'timeout' => env('LOGENTRIES_TIMEOUT', 5.0), // Leverage timeout fix
],
Log::channel('logentries') to validate handler behavior.new LogentriesHandler($token, $url, ['timeout' => 5]);
api.logentries.com with data.logentries.com in configs.timeout in handler config (if configurable) to balance reliability/latency.$handler->setFallbackHandler(new \Monolog\Handler\StreamHandler(storage_path('logs/fallback.log')));
vendor/logentries-handler-v2).use Monolog\Handler\AbstractProcessingHandler;
class LogentriesApiHandler extends AbstractProcessingHandler {
public function write(array $record): void {
$client = new \GuzzleHttp\Client(['timeout' => 5]);
$client->post(env('LOGENTRIES_URL'), [
'json' => $record['formatted'],
'headers' => ['Authorization' => 'Bearer ' . env('LOGENTRIES_TOKEN')],
]);
}
}
create_function).array to iterable).data.logentries.com is active (per release notes).token:key vs. Bearer).api.logentries.com.data.logentries.com.cURL timeout).telescope:logs to inspect failed log records.LogentriesHandler exceptions.laravel-queue-logging.| Failure Scenario | Impact | Mitigation |
|---|---|---|
data.logentries.com downtime |
Logs lost/delayed | Fallback to file + retry queue |
| Invalid timeout config | Handler hangs or crashes | Set reasonable defaults (e.g., 5s) |
| API auth token rejection | Logs silently dropped | Validate token on startup |
| PHP 8.x incompatibility | Handler throws fatal errors | Feature flag + graceful degradation |
| Logentries rate limiting | Logs throttled/dropped | Implement exponential backoff |
How can I help you explore Laravel packages today?