NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #21 most downloaded on Packagist
Sends your logs to files, sockets, inboxes, databases and various web services
Last release 8 days ago
29 Sep 2026
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
91 releases · first in 2011
Fixed Logger silently dropping every record for the rest of the process once the infinite loop guard aborted a nested logging cycle, which could hit l
Logger silently dropping every record for the rest of the process once the infinite loop guard aborted a nested logging cycle, which could hit long-running workers (#2072)RedactingFormatter letting secrets containing &, < or > through when wrapping an HtmlFormatter (#2069)SocketHandler throwing the writing timeout immediately when the first write made no progress, instead of waiting for the configured timeout (#2071)RotatingFileHandler computing the first rotation in the default timezone instead of the $timezone passed to the constructor (#2070)Full Changelog: 3.12.0...3.12.1
One column per quarter.
Added support for reading the timestamp of new records from a PSR-20 clock, via a new $clock constructor param and Logger::setClock()
$clock constructor param and Logger::setClock() (#2065)#[WithMonologChannel] on constructor/method parameters, so a channel can be bound to a single argument instead of the whole class (#2068)TelegramBotHandler breaking HTML markup when truncating or splitting long messages, open tags are now closed at the end of a chunk and reopened in the next one (#2066)RedactingFormatter not redacting secrets nested inside array values of sensitive keys (#2067)Full Changelog: 3.11.0...3.12.0
Security: Fixed potential XSS in BrowserConsoleHandler when logging user provided content
BrowserConsoleHandler when logging user provided contentRedactingFormatter to automatically redact sensitive data from records, based on key names, #[SensitiveParameter] constructor params and/or regex patterns (#2041)FrankenPhpHandler to log records via FrankenPHP's frankenphp_log() function (#2056)LogMonsterHandler which complains if the code did not log enough records before the process/request ends, like a dead man's switch for logs (#2039)FILE_PER_HOUR rotation mode to RotatingFileHandler (#2040)ErrorHandler::captureStackTraces() to attach the stack trace of PHP errors to the records it generates (#2060)NormalizerFormatter::setMaxTraceLength() to limit how many stack trace frames are included when normalizing exceptions (#2015)TelegramBotHandler to change the API URL (e.g. for a self-hosted Bot API server) and to send extra curl headers (#2029)IntrospectionProcessor's SKIP_FUNCTIONS in subclasses (#2050)$maxLength param to SyslogUdpHandler/UdpSocket to keep datagrams below the path MTU, as fragmented UDP packets are often dropped (#2049)StreamHandler truncating writes on non-blocking streams, it now loops until the whole record is written (#2016)internal[function] entries so traces are not truncated or empty (#2061)RotatingFileHandler cleanup not finding files behind stream wrappers (e.g. private://) as glob() cannot see through those (#2058)RotatingFileHandler not using the configured timezone when computing the next rotation time (#2022)DeduplicationHandler failing with an undefined array key error when the store file is written to concurrently (#2020)TelegramBotHandler swallowing errors when the API returns a non-JSON response (#2030)AbstractProcessingHandler::handle() reading $bubble directly instead of calling getBubble(), so overrides of it were ignored (#2031)ErrorHandler sets the HTTP response code and a status line was already registered (#2027)Full Changelog: 3.10.0...3.11.0
Fixed PHP 8.5 deprecation warnings ( #1997 , #2009 )
Full Changelog: 3.9.0...3.10.0
Deprecated Monolog\Test\TestCase in favor of Monolog\Test\MonologTestCase
Full Changelog: 3.8.1...3.9.0
Deprecated Monolog\DateTimeImmutable in favor of Monolog\JsonSerializableDateTimeImmutable
Full Changelog: 3.8.0...3.8.1
Fixed PHP 8.4 deprecation notices
$fileOpenMode param to StreamHandler to define a custom fopen mode to open the log file (#1913)IntrospectionProcessor (#1899)$timeout param to ProcessHandler to configure the stream_select() timeout to avoid blocking too long (default is 1.0 sec) (#1916)JsonFormatter::normalizeRecord now possibly returning stdClass instances instead of [] for empty context/extra data which may cause issues if you extend normalizeRecord, see #1906 (comment) (#1906)StreamHandler handling of write failures so that it now closes/reopens the stream and retries the write once before failing (#1882)StreamHandler error handler causing issues if a stream handler triggers an error (#1866)StreamHandler::reset not closing the stream, so that it would fail to write in some cases with long running processes (#1862)RotatingFileHandler issue where rotation does not happen in some long running processes (#1905)JsonFormatter handling of incomplete classes (#1834)RotatingFileHandler bug where rotation could sometimes not happen correctly (#1905)Full Changelog: 3.7.0...3.8.0
Added NormalizerFormatter->setBasePath(...) (and JsonFormatter by extension) that allows removing the project's path from the stack trace output
NormalizerFormatter->setBasePath(...) (and JsonFormatter by extension) that allows removing the project's path from the stack trace output (47e301d)Full Changelog: 3.6.0...3.7.0
NormalizerFormatter->setBasePath(...) (and JsonFormatter by extension) that allows removing the project's path from the stack trace output (47e301d3e)
Fixed PHP 8.4 deprecation warnings
LineFormatter->setBasePath(...) that allows removing the project's path from the stack trace output (#1873)$includeExtra option in PsrHandler to also use extra data to replace placeholder values in the message (#1852)DeduplicationHandler (#1879)GelfMessageFormatter together with the AmqpHandler (#1869)GoogleCloudLoggingFormatter (#1859)__toString failures in context data crashing the normalization process (#1868)Full Changelog: 3.5.0...3.6.0
Added ability to indent stack traces in LineFormatter via e.g. indentStacktraces(' ')
indentStacktraces(' ') (#1835)setMaxLevelNameLength(3) (#1850)[] and not {} arrays once json serialized) containing inline linebreaks in LineFormatter (#1818)WithMonologChannel attribute for integrators to use to configure autowiring (#1847)extra data leaking between handlers that have handler-specific processors set (#1819)Full Changelog: 3.4.0...3.5.0
Added LoadAverageProcessor to track one of the 1, 5 or 15min load averages
LoadAverageProcessor to track one of the 1, 5 or 15min load averages (#1803)
AsMonologProcessor attribute (#1797)TelegramBotHandler topic/message_thread_id support (#1802)FingersCrossedHandler passthruLevel checking (#1801)TestHandler method docs (#1794)display_errors string values (#1804)Fixed Logger not being serializable anymore
Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown
ClosureContextProcessor to allow delaying the creation of context data by setting a Closure in context which is called when the log record is used (#1745)op_type to create instead of the default index (#1766)BrowserConsoleHandler logging to use more appropriate methods than just console.log in the browser (#1739)WhatFailureGroupHandler not catching errors happening inside close() (#1791)GoogleCloudLoggingFormatter (#1758)AmqpHandler->setExtraAttributes not working with buffering handler wrappers (#1781)Deprecated CubeHandler and PHPConsoleHandler as both projects are abandoned and those should not be used anymore
CubeHandler and PHPConsoleHandler as both projects are abandoned and those should not be used anymore (#1734)
Logger @final as it should not be extended, prefer composition or talk to us if you are missing something7 to 0) support to Logger::log and Logger::addRecord to increase interoperability (#1723)SyslogFormatter to output syslog-like files which can be consumed by tools like lnav (#1689)__toString for objects which are not json serializable in JsonFormatter (#1733)GoogleCloudLoggingFormatter (#1719)AmqpHandler->setExtraAttributes to allow configuring attributes when using an AMQPExchange (#1724)\n or \r sequences (#1720)Added $datetime parameter to Logger::addRecord as low level API to allow logging into the past or future
$datetime parameter to Logger::addRecord as low level API to allow logging into the past or future (#1682)
Logger::useLoggingLoopDetection to allow disabling cyclic logging detection in concurrent frameworks (#1681)Monolog\Test\TestCase class as @internal to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677)The Monolog\LevelName enum does not exist anymore, use Monolog\Level->getName() instead.
Changes from RC1
Monolog\LevelName enum does not exist anymore, use Monolog\Level->getName() instead.See UPGRADE notes for details on all breaking changes especially if you are extending/implementing Monolog classes/interfaces.
This is mostly a cleanup release offering stronger type guarantees for integrators with the array->object/enum changes, but there is no big new feature for end users.
See UPGRADE notes for details on all breaking changes especially if you are extending/implementing Monolog classes/interfaces.
Noteworthy BC Breaks:
8.1.0.Monolog\LogRecord object
with public (and mostly readonly) properties. e.g. instead of doing
$record['context'] use $record->context.
In formatters or handlers if you rather need an array to work with you can use $record->toArray()
to get back a Monolog 1/2 style record array. This will contain the enum values instead of enum cases
in the level and level_name keys to be more backwards compatible and use simpler data types.FormatterInterface, HandlerInterface, ProcessorInterface, etc. changed to contain LogRecord $record
instead of array $record parameter types. If you want to support multiple Monolog versions this should
be possible by type-hinting nothing, or array|LogRecord if you support PHP 8.0+. You can then code
against the $record using Monolog 2 style as LogRecord implements ArrayAccess for BC.
The interfaces do not require a LogRecord return type even where it would be applicable, but if you only
support Monolog 3 in integration code I would recommend you use LogRecord return types wherever fitting
to ensure forward compatibility as it may be added in Monolog 4.Monolog\Level and Monolog\LevelNameResettableInterface::reset() now requires a void return type.New deprecations:
Logger::DEBUG, Logger::ERROR, etc. are now deprecated in favor of the Monolog\Level enum.
e.g. instead of Logger::WARNING use Level::Warning if you need to pass the enum case
to Monolog or one of its handlers, or Level::Warning->value if you need the integer
value equal to what Logger::WARNING was giving you.Logger::getLevelName() is now deprecated.Fixed potential XSS in BrowserConsoleHandler when logging user content
Full Changelog: 2.11.0...2.11.1
Fixed deprecation warnings in PHP 8.4/8.5
Full Changelog: 2.10.0...2.11.0
Added $fileOpenMode to StreamHandler to define a custom fopen mode to open the log file
$fileOpenMode to StreamHandler to define a custom fopen mode to open the log file (#1913)StreamHandler handling of write failures so that it now closes/reopens the stream and retries the write once before failing (#1882)StreamHandler error handler causing issues if a stream handler triggers an error (#1866)JsonFormatter handling of incomplete classes (#1834)RotatingFileHandler bug where rotation could sometimes not happen correctly (#1905)Full Changelog: 2.9.3...2.10.0
Fixed PHP 8.4 deprecation warnings
Fixed display_errors parsing in ErrorHandler which did not support string values
Fixed Logger not being serializable anymore
Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown
BrowserConsoleHandler logging to use more appropriate methods than just console.log in the browser (#1739)WhatFailureGroupHandler not catching errors happening inside close() (#1791)GoogleCloudLoggingFormatter (#1758)AmqpHandler->setExtraAttributes not working with buffering handler wrappers (#1781)Deprecated CubeHandler and PHPConsoleHandler as both projects are abandoned and those should not be used anymore
CubeHandler and PHPConsoleHandler as both projects are abandoned and those should not be used anymore (#1734)
7 to 0) support to Logger::log and Logger::addRecord to increase interoperability (#1723)__toString for objects which are not json serializable in JsonFormatter (#1733)GoogleCloudLoggingFormatter (#1719)AmqpHandler->setExtraAttributes to allow configuring attributes when using an AMQPExchange (#1724)\n or \r sequences (#1720)Added $datetime parameter to Logger::addRecord as low level API to allow logging into the past or future
$datetime parameter to Logger::addRecord as low level API to allow logging into the past or future (#1682)
Logger::useLoggingLoopDetection to allow disabling cyclic logging detection in concurrent frameworks (#1681)Monolog\Test\TestCase class as @internal to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677)Deprecated SwiftMailerHandler, use SymfonyMailerHandler instead
SwiftMailerHandler, use SymfonyMailerHandler instead
SymfonyMailerHandler (#1663)Added callType to IntrospectionProcessor
callType to IntrospectionProcessor (#1612)
Added `Monolog\LogRecord` interface that can be used to type-hint records like array|\Monolog\LogRecord $record to be forward compatible with the upco
Monolog\LogRecord interface that can be used to type-hint records like array|\Monolog\LogRecord $record to be forward compatible with the upcoming Monolog 3 changes
includeStacktraces constructor params to LineFormatter & JsonFormatter (#1603)persistent, timeout, writingTimeout, connectionTimeout, chunkSize constructor params to SocketHandler and derivatives (#1600)AsMonologProcessor PHP attribute which can help autowiring / autoconfiguration of processors if frameworks / integrations decide to make use of it. This is useless when used purely with Monolog (#1637)user_agent key in WebProcessor, disabled by default but you can use it by configuring the $extraFields you want (#1613)self (#1609)Fixed regression in StreamHandler since 2.3.3 on systems with the memory_limit set to >=20GB
* Fixed support for psr/log 3.x
Fixed memory usage when using StreamHandler and calling stream_get_contents on the resource you passed to it (#1578, #1577)
Fixed compatibility with PHP 7.2 - 7.4 when experiencing PCRE errors
Fixed Utils::getClass handling of anonymous classes not being fully compatible with PHP 8
@inheritDoc annotations having the wrong caseAdded a ton of PHPStan type annotations as well as type aliases on Monolog\Logger for Record, Level and LevelName that you can import
Added support for Elastica 7, and deprecated the $type argument of ElasticaFormatter which is not in use anymore as of Elastica 7
Fixed removing of json encoding options
Added JSON_INVALID_UTF8_SUBSTITUTE to default json flags, so that invalid UTF8 characters now get converted to �#Replacement_character) instead of bei
JSON_INVALID_UTF8_SUBSTITUTE to default json flags, so that invalid UTF8 characters now get converted to � instead of being converted from ISO-8859-15 to UTF8 as it was before, which was hardly a comprehensive solution
$ignoreEmptyContextAndExtra option to JsonFormatter to skip empty context/extra entirely from the output$parseMode, $disableWebPagePreview and $disableNotification options to TelegramBotHandlerFixed ElasticsearchHandler swallowing exceptions details when failing to index log records
Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable
BC Break: This is a major release, see UPGRADE.md for details if you are coming from a 1.x release
BC Break: This is a major release, see UPGRADE.md for details if you are coming from a 1.x release
BC Break: This is a major release, see UPGRADE.md for details if you are coming from a 1.x release
add* (e.g. addWarning) methods as well as emerg, crit, err and warn$dateFormat option to the PsrLogMessageProcessor which lets you format DateTime instances nicelymongodb extension in the MongoDBHandlerNothing published for this version
Nothing published for this version
Fixed PHP 8.1 deprecation warning
Added $dateFormat and $removeUsedContextFields arguments to PsrLogMessageProcessor (backport from 2.x)
Fixed array access on null in RavenHandler
Fixed GitProcessor type error when there is no git repo present
Fixed formatting of resources in JsonFormatter
Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable
Fixed forward-compatible interfaces to be compatible with Monolog 1.x too.
Deprecated SlackbotHandler, use SlackWebhookHandler or SlackHandler instead
BC Notice: If you are extending any of the Monolog's Formatters' normalize method, make sure you add the new $depth = 0 argument to your function sign
normalize method, make sure you add the new $depth = 0 argument to your function signature to avoid strict PHP warnings.
ResettableInterface in order to reset/reset/clear/flush handlers and processorsProcessorInterface as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers)contexts context or extra key to forward that to Sentry's contextsImproved SyslogUdpHandler's support for RFC5424 and added optional $ident argument
$ident argument
Fixed lots of minor issues in the new Slack integrations
Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily
Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues
Deprecated RotatingFileHandler::setFilenameFormat to only support 3 formats: Y, Y-m and Y-m-d
Break: StreamHandler will not close streams automatically that it does not own. If you pass in a stream (not a path/url), then it will not close it fo
%message% and other LineFormatter replacements in the subject line of emails sent with NativeMailHandler and SwiftMailerHandlerYour coding agent can read these notes before it upgrades. Set up the MCP server →