def check_date(self):
        """
        Divides logging per day. Each logging file corresponds to a specific day.
        It also removes all logging files exceeding one year.
        :return:
        """
        self.date = datetime.now().strftime('%Y-%m-%d')
        file_path = self.date + '.log'
        if file_path not in os.listdir('logs'):
            self.logger.removeHandler(self.handler)
            self.handler = logging.FileHandler('logs/' + file_path)
            self.handler.setLevel(logging.INFO)
            self.handler.setFormatter(logging.Formatter("%(levelname)s;%(asctime)s;%(message)s"))
            self.logger.addHandler(self.handler)
        oldest_log_file = os.listdir('logs')[0]
        oldest_date = oldest_log_file.split('.')[0]
        a = datetime.strptime(datetime.now().strftime('%Y-%m-%d'), '%Y-%m-%d')
        b = datetime.strptime(oldest_date, '%Y-%m-%d')
        delta = a - b
        if delta.days > 365:
            os.remove('logs/' + oldest_log_file)

        Divides logging per day. Each logging file corresponds to a specific day.
        It also removes all logging files exceeding one year.
        :return:
        
inference_api/src/main/inference/errors.py