Moe
11/21/2023, 11:03 PMlogging.yaml
file, how can I set the name of the log file to be the flow run's name? So when specifying the filename
instead of hardcoding it like C:/PrefectLogs/test.log
, I want to dynamically set it like C:/PrefectLogs/test_{flow_run_name}.log
?Marvin
11/21/2023, 11:04 PMbash
$ PREFECT_LOGGING_HANDLERS_FILE_FILENAME=/var/log/prefect-agent1.log prefect agent start -q default
However, I couldn't find a direct way to set the log filename dynamically based on the flow run's name in the logging.yaml
file. The variables available for interpolation in log messages vary by logger and it seems that the filename might not be one of them.
You might need to implement a custom solution, such as a script that starts the flow and sets the environment variable based on the flow run's name. Please note that this is just a suggestion and might require further investigation.