Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider whether we should introduce a .env file to setup logging #2428

Closed
Tracked by #2205
antonymilne opened this issue Mar 16, 2023 · 1 comment
Closed
Tracked by #2205

Comments

@antonymilne
Copy link
Contributor

antonymilne commented Mar 16, 2023

Note. In theory an implementation of this is non-breaking, so could be done at any time. But I think it will be confusing if done before #2426, which is 0.19.0.

Following #2426, a user needs to manually set KEDRO_LOGGING_CONFIG in order for conf/logging.yml to be used. We should consider whether kedro should have a system to automatically set this environment variable. Such a system would be:

  • project template includes a new .env file that defines KEDRO_LOGGING_CONFIG=conf/logging.yml
  • kedro uses something like dotenv to load this file automatically at the beginning of the kedro process
  • load_dotenv() would go at top of framework/project/__init__.py (must be before LOGGING is defined)

This ticket is not to implement the above but to consider whether we actually want to make this change.

Pros:

  • conf/logging.yml will be used automatically, no need to set the environment variable yourself (assuming we want to leave file-based logging as opt-out rather than opt-in). Hence there's not an unused file sitting in the template
  • file-based logging therefore enabled by default as it is now
  • INFO log messages from your project still get shown without needing to handle the complication Consider removing support for project-side logging.yml #2281 on the framework side

Cons:

  • an extra file in the template just to set a single environment variable that's used for logging
  • possible confusion with environment variables used in run environments

Pro or con depending on your opinion:

  • people could use the file to set other environment variables

Overall my opinion would be that we should make this change, mainly for the reason of still seeing INFO log messages from your project.

@antonymilne
Copy link
Contributor Author

Following discussion in tech design on 12 April we are shelving this idea. See #2281 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant