question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kedro default logging seems to remove other handlers?

See original GitHub issue

Description

Kedro default logging will remove other handlers.

Context

I am using clearml which is a tool for experiment tracking. It would normally log my program STDOUT included print message or logging.info() stuff. I found that when I am using Kedro with it, the log is sent to clearml properly.

ClearML: https://github.com/allegroai/clearml

Steps to Reproduce

The standard logging config provided by Kedro is this

This is a minimal snippet to reproduce the issue. To see the log properly, uncomment the line # "incremental": True,. I have written a short summary ofthis issue here. In short, the default is incremental: False which seems to remove the existing handler.

to run this, you need to install two package pip install kedro clearml

import logging
from clearml import Task
conf_logging = {
    # "incremental": True,
    "disable_existing_loggers": False,
    "version":1,
     "formatters":{
         "simple":{
             "format":"%(asctime)s - %(name)s - %(levelname)s - %(message)s"}
             }
             }

t = Task.init(project_name="test")
logging.config.dictConfig(conf_logging)
logging.warning("WARN!")
print("PRINT!")

Expected Result

Log should show up in the ClearML App

Actual Result

Log is missing

-- If you received an error, place it here.
-- Separate them if you have more than one.

Your Environment

Include as many relevant details about the environment in which you experienced the bug:

  • Kedro version used (pip show kedro or kedro -V): kedro 0.16.6
  • Python version used (python -V): 3.7
  • Operating system and version: Window 10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AntonyMilneQBcommented, Jun 28, 2021

@noklam You are right, this is a more general issue, and it would be nice if it were possible for kedro to set its own handlers without affecting existing ones. Unfortunately I don’t think there is any better option than using dictConfig here - as I understand it, this is just a general problem with Python logging handlers.

I think the best solution will be to leave the default logging.yaml as it is and add a note to the documentation about this.

0reactions
stale[bot]commented, Aug 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve logging setup in Kedro · Issue #1461 - GitHub
Remove the file-based logging handlers by default ... (a) log to info.log / errors.log in the project root (seems ugly and is different...
Read more >
Logging — Kedro 0.18.4 documentation - Read the Docs
You might sometimes need to disable file-based logging, e.g. if you are running Kedro on a read-only file system such as Databricks Repos....
Read more >
Why my Kedro logging file keeps empty? Am I missing any step?
It might be because the location 'logs/mypipeline.log' is relative to your run.py , so maybe you are trying to find the logs at...
Read more >
How to Setup and Configure Logging in Kedro - YouTube
Data Engineering is a tough job, and it can be made tougher by complex, difficult to understand data pipelines. In this series, we...
Read more >
Working with Kedro: Setup - neptune.ai documentation
You must use the special string neptune_run as the run handler in Kedro pipelines. Log metrics like accuracy to neptune_run : nodes.py
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found