add time info in log, and change the db structure