Why my Kedro logging file keeps empty? Am I missing any step?

470 views Asked by At

I am using Kedro but I can't get my logging file to be used. I am following the tutorial. The log file was created but is still empty.

Steps done:

  1. Configured logging
class ProjectContext(KedroContext):

    def _setup_logging(self) -> None:
        log = logging.getLogger(__name__)
        handler = TimedRotatingFileHandler(filename='logs/mypipeline.log', when='d', interval=1)
        f_format = logging.Formatter('%(asctime)s %(levelname)s %(funcName)s %(lineno)d %(message)s ')
        handler.setFormatter(f_format)
        log.addHandler(handler)
        log.setLevel(logging.DEBUG)
  1. Use logging (in my nodes.py file)
import logging 
log = logging.getLogger(__name__)  
log.warning("Issue warning")  
log.info("Send information")

And after running the pipeline the log file is created but keeps empty.

Any advice?

1

There are 1 answers

0
Antunes On

Ok, problem solved! It was missing the logger definition on the logging.yml file! Thank you guys for your support!