Configuring a packaged Kedro project while using a custom logging config with File Handlers raises error #4430
Replies: 3 comments
-
Hi @cariveroco, Thank you for raising this issue! We appreciate your input. We’ll take a closer look and get back to you shortly with any updates or follow-up questions. |
Beta Was this translation helpful? Give feedback.
-
Hi @cariveroco, I've tried to reproduce your issue and can see a similar problem. My observation is that the issue is resolved if the custom_logging.yml file is at the same level as where you want your logs to be stored. So in your case, you should move the custom_logging.yml inside We'll see if there's anything we can do make it work with the setup you described. |
Beta Was this translation helpful? Give feedback.
-
Thanks @cariveroco , I've turned this idea into a discussion. My understanding is that @merelcht 's comment above gave a workaround. Does that work for you? |
Beta Was this translation helpful? Give feedback.
-
Description
Importing
configure_project
fromkedro.framework.project
fails when using a custom Kedro logging config with File Handlers, if the target files of the handlers do not exist yet. The log files do not get automatically created.The
FileNotFoundError
occurs when importingproject
,session
, orstartup
fromkedro.framework
.Context
I intend to run pipelines from a packaged Kedro Project in a "clean" directory (eventually: in a docker container) using a custom logger with Rotating File Handlers. I installed the packaged Kedro project and tried to run pipelines via script, which includes first configuring the project using
kedro.framework.project.configure_project
. Since the working directory is "clean" (i.e., does not have log files yet), I expected the log files to be automatically created, as is the observed behavior when I run pipelines via CLI in my local machine (where I have direct access to the source code in the Project Directory). Instead, I'm gettingFileNotFoundError
.Steps to Reproduce
custom_logging_config.yml
file with a Rotating File Handler (e.g. level: INFO, class: logging.handlers.RotatingFileHandler, filename: logs/info.log)KEDRO_LOGGING_CONFIG
to the previously created file.session
orproject
orstartup
fromkedro.framework
Expected Result
The log files automatically get created and the execution proceeds to running the pipelines.
Actual Result
FileNotFoundError
encountered.Your Environment
Beta Was this translation helpful? Give feedback.
All reactions