illuminate/log
Illuminate Log provides Laravel’s logging layer, built on Monolog. It lets you write messages to configurable channels and stacks, including single files, daily rotation, syslog, errorlog, and external services, with context data, processors, and runtime channel selection.
Start by installing the package via Composer (composer require illuminate/log) in a standalone PHP project or when extending Laravel (it's included by default). For new projects, integrate it with a PSR-3 compatible logger (like Monolog) to get started quickly. The simplest use case is logging a message:
use Illuminate\Log\Logger;
$logger = new Logger('app', [new Monolog\Handler\StreamHandler(storage_path('logs/app.log'))]);
$logger->info('Application started');
Check the Laravel logging documentation since this package follows the same interface and patterns used in Laravel apps.
Logger instance in a service container or as a static service for DI-free scenarios.single, daily, slack) by passing Monolog handlers grouped per channel to the Logger constructor.Tap interfaces to mutate log records before dispatch (e.g., adding metadata, scrubbing secrets).$logger->info('User logged in', ['user_id' => $user->id]);
Logger extends Monolog, you can extend Logger and override log() to enforce custom level rules.LogManager, so you must manually wire handlers (no config/logging.php equivalent).Log::channel() or Log::stack() won’t be available without the full framework. Implement them yourself or use Laravel’s Log facade in actual Laravel projects instead.Symfony\Component\HttpFoundation\StreamedResponse or in-memory handlers to assert log output.How can I help you explore Laravel packages today?