Hello, for prefect 2.0 - if I want to add flow run...
# prefect-community
d
Hello, for prefect 2.0 - if I want to add flow run id in all the log statements, do I have to override format of all the loggers defined in default logging config or is there a way to apply this change by overriding only one parent logger?
k
I think the config is the preferred way, but I think you might be able to override the logger you get with
get_run_logger()
if you override it inside the flow
Have you seen the formatter section here ?
d
Yes I did try the formatter, but what I am struggling with is if I change a formatter PREFECT_LOGGING_FORMATTERS_FLOW_RUNS_FORMAT, it only will apply to log statements generated by flow run and not task run. If I want to apply a format change across all the loggers without having to set formatter for each logger separately, how do I do it ?
k
Yeah looking at the file, I think you’d need to edit them separately. I may be wrong also, I’ll find out for sure on Monday
d
Cool thank !