Repository navigation
Replies: 5 comments 1 reply
|
Putting a note here to remind myself to do a demo when we groom this. |
|
I've said it in #3446 (comment), but for the record, +1 to this. From https://12factor.net/logs:
|
|
Another point in favour of having Here is an example of a user that's puzzled because |
|
It was moved to discussion due to #3755 (comment) |
|
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] |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
The current logging configuration is too granular. We should use
rootlogger only. The exception would beinfo_loggerorerror_loggerbecause 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 -vpytest -vvProposal:
kedro run -vverbose mode - The Project logging level will be set toDEBUGbecause this should be the most common case, I want to see the log message that I wrote in the projectkedro run -vvmore verbose mode - Everything should be shown now, including any plugin logging orkedrologsContext
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
-vflag 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.ymlandlogging.ymlto have more sensible default #3687All reactions