Log a message when pruning a user account

Created on 23 February 2023, over 1 year ago

Problem/Motivation

User Prune deletes user accounts during cron runs, without logging any watchdog messages. For auditing, it would be helpful to know when a user account was deleted, and why (automatically deleted by User Prune, or manually deleted by an administrator, or manually deleted by the user themself). The latter two manual actions already produce log messages. For consistency, it would be nice if User Prune could also log a corresponding message.

Steps to reproduce

  • Enable User Prune
  • Run cron
  • Notice that users have been deleted, but there's no record of when or why

Proposed resolution

Add a \Drupal::logger call in user_prune_cron.

Remaining tasks

Review and merge https://git.drupalcode.org/project/user_prune/-/merge_requests/3 .

User interface changes

Log messages regarding user accounts deleted by User Prune will now appear in Admin > Reports > Recent log messages.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States smokris Athens, Ohio, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024