Hugo Evers
02/14/2024, 10:30 AMNok Lam Chan
02/14/2024, 11:28 AMHugo Evers
02/14/2024, 11:28 AMNok Lam Chan
02/14/2024, 11:29 AMNok Lam Chan
02/14/2024, 11:29 AMHugo Evers
02/14/2024, 11:29 AMHugo Evers
02/14/2024, 11:29 AMHugo Evers
02/14/2024, 11:29 AMHugo Evers
02/14/2024, 11:30 AMself.log_file_path = context.config_loader["logging"]["handlers"]["file"][
"filename"
]
Nok Lam Chan
02/14/2024, 11:30 AMNok Lam Chan
02/14/2024, 11:30 AMNok Lam Chan
02/14/2024, 11:30 AMNok Lam Chan
02/14/2024, 11:30 AMHugo Evers
02/14/2024, 11:51 AMNok Lam Chan
02/14/2024, 12:01 PMNok Lam Chan
02/14/2024, 12:03 PMkedro/framework/project/default_logging.yml
version: 1
disable_existing_loggers: False
handlers:
rich:
class: kedro.logging.RichHandler
rich_tracebacks: True
# Advance options for customisation.
# See <https://docs.kedro.org/en/stable/logging/logging.html#project-side-logging-configuration>
# tracebacks_show_locals: False
loggers:
kedro:
level: INFO
root:
handlers: [rich]
Hugo Evers
02/14/2024, 12:05 PMHugo Evers
02/14/2024, 12:05 PMHugo Evers
02/14/2024, 12:05 PMNok Lam Chan
02/14/2024, 12:09 PMYou will need to explicitly point the variable to the path. Logging is not included inis now independent of Kedro’s run environment and used only iflogging.yml
is set to point to it. The documentation on logging describes in detail how logging works in Kedro and how it can be customised.KEDRO_LOGGING_CONFIG
config_loader
anymore, part of the reason is we need the logging configured earlier than config loader and almost no one have environment specific logging.yml
. The default location is in conf/logging.yml
Hugo Evers
02/14/2024, 12:14 PMNok Lam Chan
02/14/2024, 12:20 PMKEDRO_LOGGING_CONFIG
with a yaml.load call
2. It should be stored in logging
module
3. use LOGGING
which can be import from kedro.framework.project
, it should be a dict like object so you can read from it
Actually I think I prefer 3. but I haven't tested this myselfHugo Evers
02/14/2024, 12:20 PMHugo Evers
02/14/2024, 12:21 PMNok Lam Chan
02/14/2024, 12:22 PMHugo Evers
02/14/2024, 12:33 PMNok Lam Chan
02/14/2024, 12:34 PMalthough i do have to say that the environment variable is quite inconvenient when deployingCan you elaborate on this?
Hugo Evers
02/14/2024, 12:40 PMHugo Evers
02/14/2024, 12:41 PMHugo Evers
02/14/2024, 12:41 PMNok Lam Chan
02/14/2024, 12:42 PMconf/logging.yml
(or CONF_BASE/logging), would it be sufficient? So environment variable is still possible, just that if you keep it in the default location you dont' have to specify it)Nok Lam Chan
02/14/2024, 12:43 PMNok Lam Chan
02/14/2024, 12:44 PMkedro run | grep <x>
would work, but by default python log are not stdout but stderrHugo Evers
02/14/2024, 12:44 PMHugo Evers
02/14/2024, 12:45 PMHugo Evers
02/14/2024, 12:46 PMHugo Evers
02/14/2024, 12:46 PMHugo Evers
02/14/2024, 12:46 PMNok Lam Chan
02/14/2024, 12:47 PMNok Lam Chan
02/14/2024, 12:48 PMi think the default should be that it reads from base if it is there, and merge/override with env/logging.yml is it is thereIt will be override most likely, so it's more consistent if you migrate from 0.18 and other configuration that read from
config_loader
, plus user don't really get to see the default_logging_config.yml
.Nok Lam Chan
02/14/2024, 12:51 PMHugo Evers
02/14/2024, 12:59 PM