Management of Log files

Hello everyone,
I have been working with log files and I have some questions regarding them.

  1. How do we prevent log files from frappe bench log directory from taking up too much space on the server?
    Is there a feature that tracks the size of existing log files and creates a new file as soon the current one is approaching the threshold size?

  2. I discovered Frappe.log is configured in the frappe/utils/logger.py file and limited to 100000 bytes maximum size. Please where can I find the script responsible for the other types:

  • worker.error.log
  • web.error.log
  • schedule.error.log
  • schedule.log

I also looking for this feature.

Found out that the log file generated by gunicorn, python rq and schedule.

I think the rotating log function can be done outside frappe, e.g. by using logrotate

Yes, I used Log Rotate to manage the log files in the /tmp folder as well.

Found that we can add these parameter in supervisor.conf :
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10

1 Like