LinkChecker works great. Thanks for the module.

I thought that LinkChecker was not listening to my 4 week interval setting because I get these two entries with every cron run...

linkchecker 02/27/2015 - 3:51pm Memory usage: 22.21 MB, Peak memory usage: 24.71 MB.
linkchecker 02/27/2015 - 3:51pm Link checks completed.

However, this article explained that all is well, https://www.drupal.org/node/1980034.

However, I keep a small log file for performance reasons and linkchecker is filling up my logs. Could you please add an optionally silent mode log mode or something? Options could include...

1. Silent - errors only
2. Normal
3. Verbose - current state

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Component: User interface » Code

Let's add a "Debug mode" or "Verbose logging" setting checkbox to to module and conditional run this watchdog call only if enabled.

Can you share a patch, please?

Alan D.’s picture

I didn't review the watchdog severity levels on all 30 or so calls, but this is a really nice way to provide control to the user. It allows users to decide what level to report and only records these to the watchdog() system.

Change in the default level to exclude debugging. About 6 new t() strings.

function linkchecker_watchdog_log($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
  if ($severity <= variable_get('linkchecker_log_settings', WATCHDOG_INFO)) {
    watchdog($type, $message, $variables, $severity, $link);
  }
}

And usage is as simple as replacing watchdog() with linkchecker_watchdog_log().

-    watchdog('linkchecker', 'Attempted to re-run link checks while they are already running.', array(), WATCHDOG_WARNING);
+    linkchecker_watchdog_log('linkchecker', 'Attempted to re-run link checks while they are already running.', array(), WATCHDOG_WARNING);
webservant316’s picture

cool. I like it.

Alan D.’s picture

Was that a RTBTC?

webservant316’s picture

not yet, sorry I wasn't more clear. hope to test next week.

webservant316’s picture

works for me. thanks!

Alan D.’s picture

Status: Needs review » Reviewed & tested by the community

Excellent, hopefully the maintainer likes it :)

webservant316’s picture

Simple and clean enough. Also a legit need for those needing a smaller log file so that linkchecker doesn't push logs off the end so quickly.

hass’s picture

Looks good to me. Commit this after some testing.

hass’s picture

  • hass committed 9f29f7d on 7.x-1.x authored by Alan D.
    Issue #2443055 by Alan D.: Optionally reduce the number of LinkChecker...
hass’s picture

Status: Reviewed & tested by the community » Fixed

I'm personally not going to backport this change as D6 is close to EOL.

Alan D.’s picture

Cool, thanks.

Now, (totally out of scope of this issue / project), to write something that combines common watchdog entries, like cron run messages so we can have a watchdog table with months worth of useful messages :)

hass’s picture

Hook_watchdog()... A simple task :-)

hass’s picture

Hook_watchdog()... A simple task :-)

Alan D.’s picture

:P delete x where y

Playing with the idea of writing something that produces a single entry per event, "cron last run w and on x,y,z" and "404 favicon.ico requested 57 times", etc; still fairly easy, just a matter of getting the time to write it :)

Status: Fixed » Closed (fixed)

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