Download the PHP package marceli-to/wiretap without Composer
On this page you can find all versions of the php package marceli-to/wiretap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marceli-to/wiretap
More information about marceli-to/wiretap
Files in marceli-to/wiretap
Package wiretap
Short Description A simplified logging package for Laravel with webhook capabilities
License MIT
Informations about the package wiretap
Wiretap Package - Laravel Logging with Webhook Support
A Laravel package for centralized logging with webhook capabilities to send structured logs to external dashboards.
Installation
1. Install via Composer
2. Publish Configuration (Optional)
This will create config/wiretap.php with configuration options.
Configuration
Environment Variables
Add these variables to your .env file:
Webhook Authentication
For webhook authentication, the package supports Bearer token authentication via the WIRETAP_WEBHOOK_SECRET environment variable (recommended approach):
This automatically adds the Authorization: Bearer your-secret-key-here header to all webhook requests.
Custom Headers (Advanced)
For additional headers beyond authentication, edit config/wiretap.php:
Then add to .env:
Note: If you configure both WIRETAP_WEBHOOK_SECRET and custom Authorization header, the webhook secret takes precedence.
Usage
Basic Logging
In Controllers
Exception Handling
Wiretap includes smart exception filtering to reduce noise from expected exceptions like validation errors, 404s, and authentication failures.
Smart Exception Logging (Recommended)
Add to app/Exceptions/Handler.php:
This automatically logs:
- ValidationException as
info(form validation failures) - AuthenticationException as
warning(login required) - ModelNotFoundException as
info(404 errors) - HTTP 4xx exceptions as
info(client errors) - HTTP 5xx exceptions as
error(server errors) - Other exceptions as
error(actual problems)
Manual Exception Logging
For explicit control over logging levels:
Conditional Logging
Use errorIf() for conditional error logging:
Job/Queue Logging
Custom Events
Alternative Usage (Without Facade)
Testing Your Setup
Quick Test
Then run:
Webhook Payload Format
The package sends data in this format:
Configuration Options
The config/wiretap.php file contains:
Customizing Exception Levels
You can customize how different exceptions are logged by modifying the exception_levels configuration:
Available levels: emergency, alert, critical, error, warning, notice, info, debug, skip
Use skip to completely ignore certain exception types.
Requirements
- PHP 8.0+
- Laravel 9.0+ | 10.0+ | 11.0+
- Guzzle HTTP client 7.0+
Features
- ✅ Multiple log levels (info, error, warning, debug, custom)
- ✅ Smart exception filtering - Reduces noise from expected exceptions
- ✅ Automatic severity detection - ValidationException → info, 404s → info, 500s → error
- ✅ Conditional logging -
errorIf()helper for cleaner code - ✅ Structured context data with automatic exception details
- ✅ Configurable exception level mapping with closure support
- ✅ Automatic application and server information
- ✅ Webhook integration with retry logic
- ✅ Laravel logging fallback
- ✅ Configurable timeouts and headers
- ✅ Laravel service provider auto-discovery
- ✅ Facade support for easy usage
Ready to centralize your logging! 📊
All versions of wiretap with dependencies
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/http Version ^9.0|^10.0|^11.0
guzzlehttp/guzzle Version ^7.0