A global configuration form should be available to allow setting values like debugging, run on cron, etc.
Debugging
This module should come with debugging options that allow developers to enable excessive logging to aid in tracking down issues with the System Monitor module and its various processes.
Cron
The global configuration form should allow toggling a default cron job implementation for all configured monitors. It should also include a disclaimer that developers should only enable it if they’re only monitoring a few processes. Otherwise they should consider using the drush command implementation.
Checklist Items
- Create configuration page for Monitor global settings
- Implement debug logging
- Create cron hook
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff-3074969-3-6.txt | 2.23 KB | robpowell |
| #6 | 3074969-6.patch | 7.89 KB | robpowell |
| #3 | 3074969-3.patch | 6.78 KB | robpowell |
Comments
Comment #2
merauluka commentedAssigning to Rob.
Comment #3
robpowellThis should satisfy 1 and 2 but I need some guidance on #3.
Comment #4
robpowellComment #5
merauluka commentedI think that this could just be self::CONFIG_NAME, right?
This could have a description on it about what this mode does. And a warning about not leaving it enabled it in production for too long since it creates TONS of log messages.
For the cron hook, you should be able to implement hook_cron in the .module file. Load in the cron setting from config to determine if it should run anything, and then add a TODO to add in the actual running of the system monitor tasks.
The ability to run those tasks is what I'm working on in #3087826: Implement logic to run monitors and tasks. And I'm super close to having that ready, but it's not quite there yet.
Comment #6
robpowellI made the above changes.
Here is a git lab diff for your convenience: 3074969
Comment #7
robpowellComment #8
merauluka commentedLooks good to me @robpowell!
Comment #9
brianwagner commentedIn SystemMonitorSettingsForm.php::buildForm(), we have two checkboxes: one defaults to "", the other defaults to 0. Do we want both to be bool values?
'#default' => isset($config['cron']) ? $config['cron'] : 0,Also do we need configFactory in SystemMonitorTaskManager.php? It doesn't seem to be implemented yet.
Comment #11
robpowellThanks brianwagner, I updated the default value. For now, let's keep configFactory.
Comment #12
robpowell