Replies: 5 comments 1 reply
-
Putting a note here to remind myself to do a demo when we groom this. |
Beta Was this translation helpful? Give feedback.
-
I've said it in #3446 (comment), but for the record, +1 to this. From https://12factor.net/logs:
|
Beta Was this translation helpful? Give feedback.
-
Another point in favour of having Here is an example of a user that's puzzled because |
Beta Was this translation helpful? Give feedback.
-
It was moved to discussion due to #3755 (comment) |
Beta Was this translation helpful? Give feedback.
-
Another problem of our approach to logging: I'm trying to get Kedro to work on Prefect by creating a very simple flow that launches a from kedro.framework.session import KedroSession
from kedro.framework.startup import bootstrap_project
from prefect import flow
@flow
def main():
bootstrap_project(Path.cwd())
with KedroSession.create() as session:
session.run()
if __name__ == "__main__":
main() However,
And since this is impossible to avoid, because
Then I have no other choice but to take care of this manually: @@ -9,6 +9,9 @@
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
handlers:
+ prefect:
+ class: prefect.logging.handlers.APILogHandler
+
console:
class: logging.StreamHandler
level: INFO
@@ -35,9 +38,11 @@
loggers:
kedro:
level: INFO
+ handlers: [prefect]
spaceflights_pandas_viz2:
level: INFO
+ handlers: [prefect]
root:
handlers: [rich, info_file_handler] |
Beta Was this translation helpful? Give feedback.
-
Description
The current logging configuration is too granular. We should use
root
logger only. The exception would beinfo_logger
orerror_logger
because they are mean to capture that specific log level.The most common case is that I want to see all the logs during debugging. In production case (packaged project), how do I even change it to see the log if I want to? Editing the configuration file doesn't seem to be a good idea.
Inspired by
pytest -v
pytest -vv
Proposal:
kedro run -v
verbose mode - The Project logging level will be set toDEBUG
because this should be the most common case, I want to see the log message that I wrote in the projectkedro run -vv
more verbose mode - Everything should be shown now, including any plugin logging orkedro
logsContext
It's hard to get logging right, in most case I either expect seeing just the default level or I want to see everything during debugging. a
-v
flag comes in handy and is a common convention among many CLI tools. i.e.pytest
.Possible Implementation
Add new argument in the CLI, and override the level of logging in
LOGGING
.Possible Alternatives
Edited 2024-03-07
I have splited this ticket to two tickets
default_logging.yml
andlogging.yml
to have more sensible default #3687Beta Was this translation helpful? Give feedback.
All reactions