copona
copona copied to clipboard
system/storage/log/error.txt rotation
This file can grow up in time. Is there any method, which rewrites and "rotates" this file?
Of course, for security, there can be minimum history which needs to be allowed, but it could be configurable. By default, set to 7 days e.g., and after that, log file is removed/renamed/compressed/archived?
We could just have daily logs, weekly or monthly logs.
I think this should be done by the operating system. It would be good to use monolog or at least psr-3 logger interface
When you are using shared hosting (although, at the moment you still need a composer. But the release will be compiled for shared), you probably will not get hoster to rotate application logs. I would say that logs could be a per-weekday basis. At least - configurable in admin.
Ok. One needs cronjobs for that? This is also something which is not available maybe on shared hosting.
e.g. if you have custom application and you put some .log file under, let's say myapp/here/logs.log
- hosting must know, that it's needed to "rotated" these log files.
May be some Hosting companies has custom configuration, to rotate application log files.
I you have dedicated server, of course, you can set up logrotate serviss as you wish.
I believe, that vqmod
approach to log files automatically, with prefixes or suffixes of weekdays is quite enough though?
https://seldaek.github.io/monolog/doc/02-handlers-formatters-processors.html#log-to-files-and-syslog monolog has a rotatingfilehandler build in
Seems to be the perfect solution, together with Whoops? https://github.com/filp/whoops/issues/62
In Production environment, Whoops must be turned off, but the logging still should be available. If it's possible to achieve with both of them?