Download the PHP package kingsoft/monolog-handler without Composer
On this page you can find all versions of the php package kingsoft/monolog-handler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kingsoft/monolog-handler
More information about kingsoft/monolog-handler
Files in kingsoft/monolog-handler
Package monolog-handler
Short Description Additional handlers monolog, log rotation and cron handler
License MIT
Informations about the package monolog-handler
Rotating and Crontab StreamingFileHandler for Monolog
This handler combines rotating (AbstractRotatingFileHandler
) with an crontab based FileHandler (CronRotatingFileHandler
) to offer a cron based rotating file handler. It is based on Cesargb\php-log-rotation
for advanced rotation and dragonmantank\cron-expression
for cron interpretation. The abstract class can be used for different ways of rotation and requires an implementation of mustRotate()
to estblish to know if a rotation is needed.
Future versions might split the two and who knows AbstractRotatingFileHandler
might end up in Monolog
...
Install and configure
Use Kingoft/Utils
to include make a global SETTINGS
available. Or look at the PHPUNIT
test file to see what is needed to configure.
CronRotatingFileHandler
Example usage
With this in the ini-file
[!IMPORTANT]
Rotation will not work if a another instance is opening the log and write an entry. This would touch the.state
and will not rotate!. This could happen for instance and API write to the same log file before a frontend application pings back to the server. In other words this logger is currently not reentrant-safe.
All versions of monolog-handler with dependencies
cesargb/php-log-rotation Version ^2.7
dragonmantank/cron-expression Version ^3.3