laravel:exception-handling-and-logging

Implement reportable and renderable exceptions with structured logging in Laravel.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2 --skill laravel-exception-handling-and-logging-patkik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel:exception-handling-and-logging
Source: https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2/tree/main/.agents/skills/exception-handling-and-logging
Command: npx skills add https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2 --skill laravel-exception-handling-and-logging-patkik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Observability and graceful failure for Laravel applications by implementing reportable/renderable exceptions, structured logging, and channel-based error routing.

Core Features & Use Cases

  • 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()

Quick Start

Configure Laravel to use reportable and renderable exception handlers with structured logs and channel-based error routing.

Frequently Asked Questions about laravel:exception-handling-and-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured logging and exception handling in Laravel?

To implement structured logging and exception handling in Laravel, define reportable and renderable exceptions that add domain-specific context to logs, route noisy errors to separate channels, and ensure API-friendly responses.

What is the best way to route noisy Laravel logs to separate channels?

Routing noisy Laravel logs to separate channels involves configuring a channel-based logging strategy in your exception handler to isolate verbose errors, keeping the default log stream actionable.

How do I convert Laravel exceptions into API-appropriate responses?

Converting Laravel exceptions into API-appropriate responses is done within the renderable method of your exception handler by mapping domain-specific exceptions like ModelNotFoundException to structured API response formats.

Does Laravel exception handling work consistently across web routes, API responses, and job queues?

Laravel exception handling works across web routes, API responses, and job queues by centralizing logic in reportable and renderable methods, ensuring uniform behavior for errors like DomainException and ModelNotFoundException.

How do I avoid logging secrets when adding structured context to Laravel exceptions?

To avoid logging secrets when adding structured context to Laravel exceptions, carefully map only domain-specific data within the reportable method, explicitly excluding sensitive request inputs from the log channels.