Create foreign key constraints for the log tables with cascading deletes
Create the foreign key constraints for the log tables with cascading deletes. That will allow all records associated to a master record to be automatically deleted when the master record is deleted and will greatly ease log maintenance.