fixes #6560 refine logging tables and triggers