We use the light weight cron, which needs to runs every 5 minutes. The watchdog is full with this messages:

Internal scheduler cron run activated
Internal scheduler cron run completed

Would be nice to have a setting to opt out these notices and only print the messages from scheduler_cron().

I could code this if the maintainer is interested in this feature.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acbramley’s picture

I needed this feature too so went ahead and implemented it.

acbramley’s picture

Status: Active » Needs review
jonathan1055’s picture

Hi, I like this idea, and the patch looks ok.
Is the log normally referred to as 'watchdog' or is it known as the 'dblog'? Not sure what terminology is best.

Also I tried to come up with a description in positive terms, which is normally the preferred way, instead of saying 'Uncheck this ...'. The best I could do was 'It is useful to have this option on while setting up and testing the internal cron. Turn it off when all is working, to save unnecessary rows in the dblog'

You could add that any actions taken by Scheduler will still be logged, it is just the 'activated' and 'completed' internal cron messages which are removed. What do you think?

Jonathan

liquid06’s picture

Title: Too many watchdog messages. Posibillity to opt out the inicial and final watchdog message. » Site administrator can opt-out of scheduler's cron activation and completion messages
Version: 7.x-1.0-rc3 » 7.x-1.x-dev
FileSize
2.69 KB
21.33 KB

I think it's called 'dblog' or 'Database logging' in other places in Drupal's UI. The patch in #1 worked for me, but it felt awkward to configure it on Scheduler's page rather than the page that talks about lightweight cron.

My patch

  • Places the checkbox on the "lightweight cron" page
  • Changes the text to use 'if checked', to use 'dblog' in place of 'watchdog', let the user know that it's only the activation and completion messages that are removed and why one might want to disable the setting.
  • Deletes the configuration variable upon uninstall

lightweight cron checkbox and help text as displayed on the lightweight cron page

I was a little confused about what to call the cron run iteself - I went with "scheduler's cron" in the description because as far as I know, it's only doing scheduler-related tasks. "Lightweight cron" sounds like something more general that other modules might use too, but I used it in the fieldset title because it matches the name of the configuration page we're on. I guess it could always say "scheduler's lightweight cron" but that's a bit wordy. (It's probably a bit wordy anyway...)

Alan D.’s picture

Status: Needs review » Needs work

I think that this should be on the main configuration page as it effects general cron runs too. I should have looked at the code, I assumed that it effected every cron run :?

There is a variable delete on "scheduler_cron_settings" in scheduler_uninstall(), did you mean "scheduler_watchdog_log"?

jonathan1055’s picture

This is a useful addition - thanks for starting it. Yes the variable names need amending. Also maybe instead of having the separate variable $log it can be condensed by testing directly.

The patch does not currently apply to the latest dev due to #1358656: Incorrect link to settings in cron dblog and will also need re-rolling if/when #1977890: Tidy up titles and descriptions is committed. That second one may also assist in reducing the wordiness.

Jonathan

wiifm’s picture

Status: Needs work » Needs review
FileSize
2.41 KB

Re-roll attached for latest --dev, also changed the variable to match the admin settings.

wiifm’s picture

Whoops, remove the extra semi colon at the end there.

jonathan1055’s picture

Status: Needs review » Needs work

Thanks for the re-worked patch in #8. However, now that #1977890: Tidy up titles and descriptions has been committed you need to re-roll it against latest dev, currently 1.1+10 dated 28th July.

Here is a suggestion for the option title and text, which adds the bit about normal actions being logged at all times. There is lots to say but I have tried to reduce the wording a bit:

[] Log every activation and completion message. 

When this option is checked, Scheduler will write an entry to the dblog every time the lightweight cron process is started and completed. This is useful during set up and testing, but can result in a large number of log entries. Any actions performed during the lightweight cron run will always be logged regardless of this setting.

Cheers,
Jonathan

acbramley’s picture

Rerolled against latest dev with text changes as per comment above.

acbramley’s picture

Status: Needs work » Needs review
jonathan1055’s picture

Title: Site administrator can opt-out of scheduler's cron activation and completion messages » Turn off scheduler's lightweight cron activation and completion messages
Status: Needs review » Needs work

Excellent, thanks for re-rolling the patch. Tested and looks good.

Just one minor thing (which I'm sorry I did not spot before) - please can you change the stored variable name from 'scheduler_watchdog_log' to 'scheduler_lightweight_log'. This variable is specifically for the lightweight messages, and we do not need both 'watchdog' and 'log' in the name. It is better to be specific about the name, to help future developers.

Thanks again.

Jonathan

acbramley’s picture

Status: Needs work » Needs review
FileSize
2.81 KB

Rerolled with new settings, I've used proper git format-patch for this one

jonathan1055’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for changing the variable name.
Tested against dev of 28th July, 7.x-1.1+10, and all ok. RTBC

Jonathan

ps there are quite a few other patches which need review. The big interesting one is #773510: Integration with Rules module
but there are also simpler ones such as #1898784: Make log revision text translatable and
#1804508: Extra spaces in date format causes 'Publish on' not to match the expected format
Just thought I'd mention it, if you feel like doing some testing ;-)

rickmanelius’s picture

Status: Reviewed & tested by the community » Closed (fixed)
rickmanelius’s picture

Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.