Hi all. Is there a way to filter out default prefe...
# prefect-community
a
Hi all. Is there a way to filter out default prefect logs like:
Copy code
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
You could set an env var PREFECT_LOGGING_LEVEL="WARNING"
a
this holds for
Prefect
v1? Any way to filter messages as opposed to changing the level?
r
ah sorry - never used v1
r
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