https://prefect.io logo
Title
a

Andreas Tsangarides

10/26/2022, 8:20 AM
Hi all. Is there a way to filter out default prefect logs like:
Starting task run...
[2022-10-25 15:23:07+0100] INFO - prefect.TaskRunner | Task 'read_features_config[1]': Starting task run...
[2022-10-25 15:23:07+0100] INFO - prefect.TaskRunner | Task 'read_features_config[3]': Finished task run for task with final state: 'Success'
1️⃣ 1
1
r

redsquare

10/26/2022, 8:40 AM
You could set an env var PREFECT_LOGGING_LEVEL="WARNING"
a

Andreas Tsangarides

10/26/2022, 8:46 AM
this holds for
Prefect
v1? Any way to filter messages as opposed to changing the level?
r

redsquare

10/26/2022, 8:47 AM
ah sorry - never used v1
r

Rob Freedy

10/26/2022, 12:52 PM
You could use a combination of using the
getLogger
and
setLevel
logger methods to create a customer logger as well as well as setting the Prefect logging level in the environment variable
PREFECT_LOGGING_LEVEL
to only get your logs and not the default logs as described at the bottom of this post: https://discourse.prefect.io/t/how-do-i-suppress-created-task-run-logs/750/7