Thread
#prefect-community
    d

    Darshan

    6 months ago
    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?
    Kevin Kho

    Kevin Kho

    6 months ago
    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

    Darshan

    6 months ago
    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 ?
    Kevin Kho

    Kevin Kho

    6 months ago
    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

    Darshan

    6 months ago
    Cool thank !