Log Files from Laravel Pail Are Not Automatically Cleaned, Leading to Disk Space Issues
Laravel Package Version
v1.1.4
Laravel Version
11.23.5
PHP Version
8.3.11
Database Driver & Version
No response
Description
Laravel Pail continuously generates log files, but they do not appear to be automatically cleaned up. Over time, this causes disk space to fill up, which can lead to performance issues or system failures in production environments.
Steps To Reproduce
- Use Laravel Pail for logging.
- Let the application run for an extended period (e.g., several days/weeks).
- Check the storage/pail/ directory and observe that .pail log files keep accumulating.
Expected Behavior
There should be an automatic mechanism to rotate or delete old .pail log files, or at least a configuration option to define log retention policies.
Actual Behavior
Logs continue to grow indefinitely without an apparent cleanup mechanism, leading to excessive disk usage.
Possible Solutions / Workarounds
- Is there a way to configure log retention in Pail?
- Should users manually set up cron jobs or Laravel scheduler tasks to delete old .pail logs?
Would appreciate any guidance on how to handle this! Thanks.
I'd like to take the opportunity to ask if it's possible to view old logs through Pail. Since they are available in files, would it be possible to view them? This would be helpful for reviewing logs retrospectively, not just in real-time.