Add function to migrate logs from each log file to the database