Create a log of create/delete users in Drupal 7 I'm creating a log with several actions in drupal.

I register similar actions with hook_watchdog.

/**
* Implements hook_watchdog().
*/
function MYMODULE_log_watchdog(array $log_entry) {

  if($log_entry['message']=='Login attempt failed for %user.'){
    my_log_function();
  }
}


But I do not know how to detect that is created or deleted a user, and record this information in my custom log.

I'm new in drupal development and I Appreciate any guidance to investigate. Thanks :)
You could actually log the details about user creation at hook_user_insert(), and deletion using hook_user_delete().

User creation: Acts on new user creation

function MODULE_user_insert(&amp;$edit, $account, $category) {
  watchdog('user', 'User created with ID: %userid', array('%userid' =&gt; $account-&gt;uid]), WATCHDOG_NOTICE, $link = NULL);
}


User deletion: Acts on account deletion

function MODULE_user_delete($account) {
  watchdog('user', 'User having ID: %userid deleted', array('%userid' =&gt; $account-&gt;uid]), WATCHDOG_NOTICE, $link = NULL);
}