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

Make framework-side logging.yml user-specifiable #2206

Closed
Tracked by #2205
antonymilne opened this issue Jan 16, 2023 · 0 comments · Fixed by #2535
Closed
Tracked by #2205

Make framework-side logging.yml user-specifiable #2206

antonymilne opened this issue Jan 16, 2023 · 0 comments · Fixed by #2535
Assignees

Comments

@antonymilne
Copy link
Contributor

antonymilne commented Jan 16, 2023

Note. Non-breaking, goes in 0.18.x.

As explained in #2205, there's a portion of framework-side logging setup in _ProjectLogging that cannot be modified by users. It would solve several issues if we could come up with a way to make this code user-accessible:

The proposed solution is to introduce an environment variable KEDRO_LOGGING_CONFIG (name tbc) which allows a user to provide an path to a logging.yml configuration file instead of the framework default_logging.yml. A user could then run export KEDRO_LOGGING_CONFIG=conf/base/logging.yml for example.

Docs will need to be updated with this.

The new code in _ProjectLogging would look something like this:

class _ProjectLogging(UserDict):
    # pylint: disable=super-init-not-called
    def __init__(self):
        """Initialise project logging. The path to logging configuration is given in
        environment variable KEDRO_LOGGING_CONFIG (defaults to default_logging.yml)."""
        path = os.environ.get("KEDRO_LOGGING_CONFIG", Path(__file__).parent / "default_logging.yml")
        logging_config = Path(path).read_text(encoding="utf-8")
        self.configure(yaml.safe_load(logging_config))
        ...
@antonymilne antonymilne changed the title Make framework logging side setup configurable Make framework-side logging setup configurable Jan 16, 2023
@antonymilne antonymilne added the Stage: Technical Design 🎨 Ticket needs to undergo technical design before implementation label Jan 16, 2023
@antonymilne antonymilne changed the title Make framework-side logging setup configurable Make framework-side logging.yml user-specifiable Feb 2, 2023
@merelcht merelcht removed the Stage: Technical Design 🎨 Ticket needs to undergo technical design before implementation label Mar 1, 2023
@merelcht merelcht moved this to To Do in Kedro Framework Mar 16, 2023
@noklam noklam self-assigned this Apr 18, 2023
@noklam noklam moved this from To Do to In Progress in Kedro Framework Apr 18, 2023
@NeroOkwa NeroOkwa moved this from In Progress to In Review in Kedro Framework Apr 24, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in Kedro Framework Apr 28, 2023
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

Successfully merging a pull request may close this issue.

3 participants