logic for detail log