Monolog\Logger::API
can be used to distinguish between a Monolog 1
and 2
install of Monolog when writing integration code.
Removed non-PSR-3 methods to add records, all the add*
(e.g. addWarning
)
methods as well as emerg
, crit
, err
and warn
.
DateTime are now formatted with a timezone and microseconds (unless disabled). Various formatters and log output might be affected, which may mess with log parsing in some cases.
The datetime
in every record array is now a DateTimeImmutable, not that you
should have been modifying these anyway.
The timezone is now set per Logger instance and not statically, either via ->setTimezone or passed in the constructor. Calls to Logger::setTimezone should be converted.
HandlerInterface
has been split off and two new interfaces now exist for
more granular controls: ProcessableHandlerInterface
and
FormattableHandlerInterface
. Handlers not extending AbstractHandler
should make sure to implement the relevant interfaces.
HandlerInterface
now requires the close
method to be implemented. This
only impacts you if you implement the interface yourself, but you can extend
the new Monolog\Handler\Handler
base class too.
There is no more default handler configured on empty Logger instances, if you were relying on that you will not get any output anymore, make sure to configure the handler you need.
datetime
is not sent anymore. Only timestamp
is sent to Loggly.warning.channel
routing key instead of warn.channel
as in 1.x.{date}
and the date format must be set
to one of the predefined FILEPER* constants to avoid issues with file rotation.
See setFilenameFormat
.