add close method for log