added event logging to history cleaning