CRM
CRM copied to clipboard
Create admin task if too many log files are in logs directory
Some Gitter discussion about whether ChurchCRM or external tools (i.e. logrotate) should be responsible for cleaning up old log files.
Hybrid approach: Create an admin task that becomes active when > X
number of log files are in the logs directory, and display page to kick off a manual clean up within app.
As an old neck-beard...this approach displeases me (read that in the voice of Darth Vader...it's tongue-in-cheek).
Log management is not a function of the app, it is a function of the admin. Granted, there are people running the app who are not admins and just want "stuff to work" out of the box. Personally, I'd like a branched logic on this one:
- Allow CCRM admins to specify internal (CCRM log management) or external (logrotate/newsyslogd/etc) log management.
- If internal - run an admin task etc, as you describe in this ticket, keeping the existing date-stamped file names etc.
- If external - write to a static log file name and leave it to the admin to handle.
A link to a relevant wiki page describing how these options affect the logging behaviour would be nice too.
@MrClever I like your proposed approach here.
Your proposed change to the behavior of log filenames also seems good, with one caveat: There are a few places where ChurchCRM might write to logs before admin-specified settings are available. This is mostly in the scenario of a failure in the boot-loader or database connection issue. In these cases, I think we should default to the current implementation of timestamped log filenames. Thoughts?
@crossan007 - agreed. No "in-app" solution is going to be 100% perfect due to the reasons you state above. I guess having some sort of message/alert to the admin if they select "external" management that there are some corner-cases where arbitrary log file may be created, would suffice. Then (as an old school neck-beard) I can roll in some "pre-management" routine (like prerotate
in logrotated
config) to scoop up errant logs and do stuff (delete/move/merge/etc) with them.
In general, I generally don't mind if things are a little "odd" provided users/admins are made aware of the oddness and can therefore make informed decisions. Even if it's a link to a more detailed explanation on the wiki 👍
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 15 days with no activity.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 15 days with no activity.