Camilo López
01/12/2024, 3:18 PM@op
def run_kedro_terminal(context: OpExecutionContext):
process = Popen("kedro run", stdout=PIPE, stderr=STDOUT, shell=True)
with process.stdout:
log_subprocess_output(context, process.stdout)
process.wait()
2.- Running in code
@op
def kedro_run(context: OpExecutionContext):
project_entry = Path(os.getcwd())
bootstrap_project(project_entry)
with KedroSession.create(project_path=project_entry) as session:
session.run()
By now i'm not able to show the kedro logs on the 2nd option, i found out that logger = get_dagster_logger()
enables me to log properly inside code/function of kedro, but i haven't found a way to show kedro logs for nodes and pipelines execution sadblob (edited)Camilo López
01/12/2024, 3:19 PMdef log_subprocess_output(context, pipe):
for line in iter(pipe.readline, b''):
context.log.info(line.decode('utf-8'))
• On option 2: Kedro logs (like INFO Running node
) are not being showeddatajoely
01/12/2024, 3:19 PMdatajoely
01/12/2024, 3:20 PMdatajoely
01/12/2024, 3:20 PMCamilo López
01/12/2024, 3:23 PMNok Lam Chan
01/12/2024, 3:33 PMlogging
module.Nok Lam Chan
01/12/2024, 3:33 PMCamilo López
01/12/2024, 3:47 PMpython_logs:
managed_python_loggers:
- my_logger
- my_other_logger
I tried with no results:
python_logs:
managed_python_loggers:
- kedro
- kedro_handler
datajoely
01/12/2024, 3:51 PMCamilo López
01/12/2024, 3:53 PMversion: 1
disable_existing_loggers: False
formatters:
simple:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
handlers:
console:
class: logging.StreamHandler
level: INFO
formatter: simple
stream: <ext://sys.stdout>
info_file_handler:
class: logging.handlers.RotatingFileHandler
level: INFO
formatter: simple
filename: logs/info.log
maxBytes: 10485760 # 10MB
backupCount: 20
encoding: utf8
delay: True
error_file_handler:
class: logging.handlers.RotatingFileHandler
level: ERROR
formatter: simple
filename: logs/errors.log
maxBytes: 10485760 # 10MB
backupCount: 20
encoding: utf8
delay: True
rich:
class: rich.logging.RichHandler
loggers:
kedro:
level: INFO
minio_spaceflights:
level: INFO
root:
handlers: [rich, info_file_handler, error_file_handler]
datajoely
01/12/2024, 3:53 PMrich
with console
Nok Lam Chan
01/12/2024, 4:28 PMlookslike you can put the logger names that you need to capture on dagster.ymlwhat's the name of your logger? you mentioned the log inside node is logged correctly.
Camilo López
01/12/2024, 5:08 PMlogger = get_dagster_logger()
Camilo López
01/15/2024, 12:33 PMKEDRO_LOGGING_CONFIG=<project_root>/conf/logging.yml
in the Dockerfile, after that the changes in the logging.yml worked properlyCamilo López
01/15/2024, 12:33 PMENV KEDRO_LOGGING_CONFIG=/opt/dagster/app/conf/base/logging.yml
Camilo López
01/15/2024, 12:34 PMNok Lam Chan
01/15/2024, 12:38 PMNok Lam Chan
01/15/2024, 12:39 PMCamilo López
01/15/2024, 12:39 PMCamilo López
01/15/2024, 12:44 PM[dark_orange]
or colors in the kedro default logging ?Nok Lam Chan
01/15/2024, 1:53 PMrich
specific?datajoely
01/15/2024, 1:55 PMdatajoely
01/15/2024, 1:55 PMNO_COLOR=true
datajoely
01/15/2024, 1:55 PMGeorge p
04/07/2024, 3:01 AMNok Lam Chan
04/08/2024, 8:45 AMCamilo López
04/08/2024, 2:50 PMCamilo López
04/08/2024, 2:50 PMdatajoely
04/08/2024, 2:52 PMNok Lam Chan
04/08/2024, 2:56 PMNok Lam Chan
04/08/2024, 2:57 PMJuan Luis
04/08/2024, 3:43 PMGeorge p
04/09/2024, 9:04 AMGeorge p
05/19/2024, 9:23 PMFlorian d
05/22/2024, 9:50 AM