LOG_LEVEL=error for production vs. debug for staging), enabling feature flags for gradual rollout.guzzlehttp/guzzle (for HTTP alerts) and monolog/monolog. Version conflicts with other packages (e.g., laravel/framework) are possible but manageable via Composer constraints.debug level) may overwhelm third-party services. Needs log-level gating (e.g., only error/critical).debug, error, etc.) map to alert channels (e.g., Telegram for critical, Sentry for all)?guzzlehttp/guzzle (v7+).sentry/sentry-laravel (if not already in use). May conflict with existing Sentry SDK.database, redis) to avoid blocking log writes.Phase 1: Pilot Deployment
composer require bazoonchik/critical-alerts.config/logging.php:
'handlers' => [
'critical_alerts' => [
'class' => 'Bazoonchik\CriticalAlerts\Handler\CriticalAlertHandler',
'services' => ['telegram', 'sentry'],
'level' => 'error', // Start with high-severity only
],
],
Phase 2: Gradual Rollout
warning level alerts.config/alerts.php):
'telegram' => [
'enabled' => env('ALERT_TELEGRAM_ENABLED', false),
'token' => env('TELEGRAM_BOT_TOKEN'),
'chat_id' => env('TELEGRAM_CHAT_ID'),
],
Phase 3: Production Hardening
Illuminate\Support\Facades\Retry).ProcessorInterface. Ensure no conflicts with existing processors (e.g., Monolog\Processor\UidProcessor).ServiceInterface is implemented correctly.Log::channel() for critical paths).bootstrap/app.php:
$logging->useHandler(\Bazoonchik\CriticalAlerts\Handler\CriticalAlertHandler::class);
debug from alerts).guzzlehttp/guzzle and monolog/monolog for breaking changes. Pin versions in composer.json.alerts Monolog handler).telnet or curl to manually test Telegram/Sentry endpoints during outages.| Issue Type | Owner | Resolution Path |
|---|---|---|
| Telegram API fails | DevOps/SRE | Check rate limits, retry logic |
| Sentry quota exceeded | Backend Team | Upgrade plan or filter alerts |
| Logs not alerting | QA/TPM | Verify Monolog handler registration |
'handlers' => [
'async_alerts' => [
'class' => 'Bazoonchik\CriticalAlerts\Handler\AsyncCriticalAlertHandler',
'queue' => 'alerts',
],
],
Log::alert() IDs) is needed to avoid duplicate notifications.| Failure Scenario | Impact | Mitigation Strategy |
|---|---|---|
| Telegram API rate-limited | Alerts dropped | Exponential backoff + queue buffering |
| Sentry DSN misconfigured | Alerts fail silently | Health checks + alert on Sentry API failures |
| Monolog handler misconfigured | No alerts triggered | CI validation of handler registration |
| Third-party service outage | Critical alerts lost | Multi-channel fallback (e.g., email + SMS) |
Log flood (e.g., debug level) |
API throttling | Strict log-level filtering |
How can I help you explore Laravel packages today?