Send application errors to email and a monitoring service simultaneously while keeping a local backup log file.
Add request IDs and user information to every log entry automatically using processors.
Filter debug messages to a development log file while sending only errors and warnings to production monitoring.
Integrate logging into a Laravel or Symfony app without writing custom code, since those frameworks use Monolog by default.
Monolog is a PHP logging library, a tool for recording events, errors, and diagnostic messages from your application to a variety of destinations. Rather than using PHP's built-in error logging (which only writes to a single file), Monolog lets you send log messages to multiple places simultaneously and in different formats. The library uses a concept called "handlers", pluggable components that each know how to send a log message somewhere. You stack multiple handlers on a logger, and each message flows through them. Destinations include local files, system log sockets, email inboxes, databases, and many external web services and monitoring platforms. You can also attach "processors" that add extra information to log records (like the current user, request ID, or memory usage) and "formatters" that control how the output looks. Monolog implements PSR-3, which is a community standard interface for PHP loggers. Because it follows this standard, it integrates out of the box with many popular PHP frameworks, including Symfony, Laravel, and others, those frameworks use Monolog as their built-in logger. The library handles standard log severity levels (debug, info, warning, error, critical, etc.), and you can configure each handler to only process messages above a certain severity. Monolog version 3 requires PHP 8.1 or later. You install it using Composer, the standard PHP package manager. It is open source under the MIT license.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.