to save log entry to db