You are here

README.txt in Watchdog Filtering 7

Same filename and directory in other branches
  1. 6 README.txt
This module allows you to filter your watchdog messages based on
severity level. It can also deduplicate the watchdog messages.

New log types will only be available to filtering _after_ the first
message has been logged using the log type.

`hook_watchdog_filtering()` is also exposed by this module. Example from
`watchdog_filtering.api.php`:

/**
 * Filter watchdog log entry. Works similar to hook_node_access().
 *
 * @param array $log_entry
 *   The watchdog log entry
 */
function hook_watchdog_filtering(array $log_entry) {
  // Never watchdog page not found messages.
  if ($log_entry['type'] == 'page not found') {
    return WATCHDOG_FILTERING_EXCLUDE;
  }

  // "Always" watchdog php messages.
  if ($log_entry['type'] == 'php') {
    return WATCHDOG_FILTERING_INCLUDE;
  }

  // Don't affect filtering on other messages.
  return WATCHDOG_FILTERING_IGNORE;
}

File

README.txt
View source
  1. This module allows you to filter your watchdog messages based on
  2. severity level. It can also deduplicate the watchdog messages.
  3. New log types will only be available to filtering _after_ the first
  4. message has been logged using the log type.
  5. `hook_watchdog_filtering()` is also exposed by this module. Example from
  6. `watchdog_filtering.api.php`:
  7. /**
  8. * Filter watchdog log entry. Works similar to hook_node_access().
  9. *
  10. * @param array $log_entry
  11. * The watchdog log entry
  12. */
  13. function hook_watchdog_filtering(array $log_entry) {
  14. // Never watchdog page not found messages.
  15. if ($log_entry['type'] == 'page not found') {
  16. return WATCHDOG_FILTERING_EXCLUDE;
  17. }
  18. // "Always" watchdog php messages.
  19. if ($log_entry['type'] == 'php') {
  20. return WATCHDOG_FILTERING_INCLUDE;
  21. }
  22. // Don't affect filtering on other messages.
  23. return WATCHDOG_FILTERING_IGNORE;
  24. }