https://flyte.org logo
Title
h

honnix

11/11/2022, 4:59 PM
Hi. A quick question. Looking at https://github.com/flyteorg/flytekit/blob/master/flytekit/loggers.py, does it mean in a python task if I do
context.user_space_params.logging.warning(msg)
, I will get json log by default? Thanks.
k

Ketan (kumare3)

11/11/2022, 5:00 PM
Yes
h

honnix

11/11/2022, 5:11 PM
Cool. Thanks. I guess it should be doable to customize the formatter? Thinking of stackdriver logging that requires a different json format.
y

Yee

11/11/2022, 7:51 PM
you can try to import
ch
and override the formatter https://github.com/flyteorg/flytekit/blob/master/flytekit/loggers.py#L42
but that seems pretty hacky
h

honnix

11/17/2022, 7:54 PM
Sorry I missed these messages. Yeah it’s pretty hacky, and it would be great if there is a way to inject the json config somewhere not in user code.