draw/log
Lightweight Laravel logging helper package providing a simple API to write structured log entries and streamline application debugging. Integrates with Laravel’s logger, supports common log levels, and keeps logging consistent across your services.
Log facade without breaking existing log consumers (e.g., Monolog\Handler\StreamHandler).EventDispatcher, enabling event-driven logging (e.g., logging user actions, security events). This is particularly valuable for Laravel apps using Symfony components (e.g., symfony/security-bundle).draw/dependency-injection, which aligns with Laravel’s service container but may introduce coupling to the draw ecosystem if overused.single, daily) remain unaffected.monolog/monolog (already in Laravel) and psr/log (also included). No additional runtime dependencies beyond these.draw/dependency-injection and draw/user-bundle, which are not mandatory for basic logging but may be needed for advanced features (e.g., event-driven logging). This could complicate adoption if the app avoids the draw ecosystem.symfony/event-dispatcher, symfony/http-foundation). Laravel 10+ uses Symfony 6.4, so integration is smooth, but older Laravel versions may require upgrades.draw/* bundles risk vendor lock-in, making it harder to migrate away if the app’s needs diverge. Evaluate whether these bundles are optional or core.symfony/http-foundation is unnecessary for CLI-based logging.Value Proposition Over Laravel’s Logger:
Log facade or Monolog’s built-in handlers cannot? Examples:
Kernel::terminate or Auth::attempt).Dependency Isolation:
draw/dependency-injection and draw/user-bundle required for core logging functionality, or are they optional for advanced features?Backward Compatibility:
config/logging.php) out of the box, or requires custom setup?Performance and Scaling:
Failure Modes and Resilience:
EventDispatcher or DI container fails?Testing and Reliability:
Maintenance and Longevity:
spatie/laravel-logging, monolog/monolog extensions) that are more mature?Laravel-Specific Integration:
Log::channel())?debug, info, error) and stacked handlers?| Stack Component | Fit Level | Notes |
|---|---|---|
| Laravel 10+ (PHP 8.5+) | Excellent | Native Monolog integration; minimal conflicts with Symfony 6.4. |
| Laravel 9.x (PHP 8.1/8.2) | Poor | PHP 8.5 requirement blocks adoption without upgrades or forks. |
| Symfony 6.4+ Apps | Excellent | Designed for Symfony’s ecosystem; event-driven logging works seamlessly. |
| Non-Symfony/PHP Apps | Poor | Heavy Symfony dependencies may bloat the app unnecessarily. |
| Monolog Users | Excellent | Extends Monolog’s capabilities without replacing it. |
| Laravel’s Log Facade | Good | Can coexist as a secondary handler or replacement for specific use cases. |
Assessment Phase:
StreamHandler, SyslogHandler).Proof of Concept (PoC):
// config/logging.php
'channels' => [
'api' => [
'driver' => 'custom',
'handler' => \Draw\Log\Handler\JsonHandler::class, // Hypothetical
'level' => 'debug',
],
],
// In a controller
Log::channel('api')->info('User action', ['user_id' => 123, 'metadata' => [...]]);
Incremental Rollout:
config/logging.php alongside existing handlers.'channels' => [
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'mon
How can I help you explore Laravel packages today?