pail icon indicating copy to clipboard operation
pail copied to clipboard

Log Files from Laravel Pail Are Not Automatically Cleaned, Leading to Disk Space Issues

Open dimsav opened this issue 10 months ago • 1 comments

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

  1. Use Laravel Pail for logging.
  2. Let the application run for an extended period (e.g., several days/weeks).
  3. 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.

dimsav avatar Feb 20 '25 09:02 dimsav

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.

Catlike14 avatar Mar 12 '25 12:03 Catlike14