# Preparations
# go to the IDE
# open the `core/units/users/users_event_handler.php` file for editing
# add the `trigger_error('sample error', E_USER_ERROR);` code after `parent::SetCustomQuery($event);` in the `\UsersEventHandler::SetCustomQuery` function
# save changes
# open the `core/units/logs/system_logs/system_log_eh.php` file for editing
# add this code and save changes:
```
lang=php
protected function OnBeforeItemDelete(kEvent $event)
{
parent::OnBeforeItemDelete($event);
die('never executed');
}
```
# Testing
# login to the Admin Console
# go to the {nav User Management > Administrators} section several times to generate several (> 3 records in the System Log)
# in the database adjust `SystemLog.LogTimestamp` column for one of the records to be 6 months old
# go to the {nav Logs & Reports > System Log} section
# remember records in there and their LogTimestamp column values
# go to the {nav Configuration > Website > Scheduled Tasks} section
# run the `rotate_system_logs` scheduled task
# confirm, that above added `die(...)` code wasn't executed
# go to the {nav Logs & Reports > System Log} section
# confirm, that records older than 1 month were deleted
# select a few (not all) records > press `Delete` button > confirm record removal
# confirm, that above added `die(...)` code wasn't executed
# confirm, that selected records were removed
# press `Delete All` button > confirm record removal
# confirm, that above added `die(...)` code wasn't executed
# confirm, that all records were removed