abstract log and db