laravel:exception-handling-and-logging
Use reportable/renderable exceptions, structured logs, and channel strategy for observability and graceful failures
Works with
---
name: laravel:exception-handling-and-logging
description: Use reportable/renderable exceptions, structured logs, and channel strategy for observability and graceful failures
license: MIT
---
# Exception Handling and Logging
Treat errors as first-class signals; provide context and paths to remediation.
## Commands
```
// app/Exceptions/Handler.php
public function register(): void
{
$this->reportable(function (DomainException $e) {
Log::warning('domain exception', ['code' => $e->getCode()]);
});
$this->renderable(function (ModelNotFoundException $e, $request) {
if ($request->expectsJson()) {
return response()->json(['message' => 'Not Found'], 404);
}
});
}
```
## Patterns
- Use domain-specific exceptions for expected error paths
- Add structured context to logs; avoid logging secrets
- Route noisy logs to separate channels; keep defaults actionable
- Convert to API-appropriate responses in `renderable()`More Observability skills
google-agents-cli-observability
google/agents-cli
>
azure-observability
microsoft/azure-skills
Azure Observability Services including Azure Monitor, Application Insights, Log Analytics, Alerts, and Workbooks. Provides metrics, APM, distributed tracing, KQL queries, and interactive reports. USE FOR: Azure Monitor, Application Insights, Log Analytics, Alerts, Workbooks, metrics, APM, distributed tracing, KQL queries, interactive reports, observability, monitoring dashboards. DO NOT USE FOR: instrumenting apps with App Insights SDK (use appinsights-instrumentation), querying Kusto/ADX clusters (use azure-kusto), cost analysis (use azure-cost-optimization).
workers-best-practices
cloudflare/skills
Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

