How can I filter sensitive data being recorded in calls to Watchdog
Assuming you're dealing with the dblog module, this is a workable solution:


Disable the dblog module
Copy dblog_watchdog into your own module's hook_watchdog implementation
Wrap each of the appropriate database field entries with your function to sanitise the string, e.g.

Database::getConnection('default', 'default')-&gt;insert('watchdog')
  -&gt;fields(array(
    'uid' =&gt; $log_entry['uid'],
    'type' =&gt; mymodule_sanitise(drupal_substr($log_entry['type'], 0, 64)),
...



If you have other watchdog modules in use, you'll need a copy/edited hook_watchdog version for each of them too.