https://prefect.io logo
#prefect-community
Title
# prefect-community
j

Jonathan Mathews

05/04/2022, 8:33 PM
Hi again! If I’m using a prefect task (such as SnowflakeQuery or dbtshell) and want to set custom logging, how do I do that. For example, at the moment I have “Task ’SnowflakeQuery[52] Starting Run” …. “Task ’SnowflakeQuery[53] Starting Run” … “Task ’SnowflakeQuery[54] Starting Run” and instead I want to have “File load query file1.txt” ….. “File load query file2.text”. Is that possible? Can I just pass in names and mappings via the name task_args? Also, how do I set retries? Do I pass task_args too?
k

Kevin Kho

05/04/2022, 8:38 PM
SnowflakeQuery
and all tasks in the task libraries can take in task args like retries and results and caching
For additional logging like that, maybe add a dynamic
task_run_name
like this ?
j

Jonathan Mathews

05/04/2022, 8:44 PM
Excellent! That looks like it will wok. Thanks again
Can I add that task_run_name to the snowflakequery task?
k

Kevin Kho

05/04/2022, 9:01 PM
Yeah you can in the
___init___
3 Views