CRM icon indicating copy to clipboard operation
CRM copied to clipboard

Create admin task if too many log files are in logs directory

Open crossan007 opened this issue 4 years ago • 6 comments

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.

crossan007 avatar Sep 16 '19 15:09 crossan007

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:

  1. Allow CCRM admins to specify internal (CCRM log management) or external (logrotate/newsyslogd/etc) log management.
  2. If internal - run an admin task etc, as you describe in this ticket, keeping the existing date-stamped file names etc.
  3. 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 avatar Sep 16 '19 23:09 MrClever

@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 avatar Sep 18 '19 21:09 crossan007

@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 👍

MrClever avatar Sep 19 '19 00:09 MrClever

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.

github-actions[bot] avatar Apr 12 '24 02:04 github-actions[bot]

This issue was closed because it has been stalled for 15 days with no activity.

github-actions[bot] avatar Apr 28 '24 02:04 github-actions[bot]

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.

github-actions[bot] avatar Jun 29 '24 02:06 github-actions[bot]

This issue was closed because it has been stalled for 15 days with no activity.

github-actions[bot] avatar Aug 13 '24 02:08 github-actions[bot]