Log refactoring, the_end field added, check to avoid multiple table_wakeup.