<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def attach(self):
 """ method clears existing log_recorder entries for given parent_object_id, creates a new one and attaches this handler to the logger from this moment every log record will be recorded in the DB """

        log_recording = LogRecording(parent_object_id=self.parent_object_id, created_at=datetime.utcnow())
        self.log_recording_dao.remove(self.parent_object_id)
        self.log_recording_dao.update(log_recording)

        formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',
                                      datefmt='%Y-%m-%d %H:%M:%S')
        self.setFormatter(formatter)
        self.logger.addHandler(self)