Is there a way to write prefect logs to a file, di...
# prefect-community
k
Is there a way to write prefect logs to a file, different for each wokrqueue ? I am referring to this prefect doc https://discourse.prefect.io/t/how-to-stream-prefect-logs-to-a-file/1963
c
Hi Khyaati, If you have a separate agent per work-queue, you can configure it at each agent
Or if you know ahead of time, you can create custom log files, for each work queue
It’s up to you how you want to isolate / segment the logging
This article just discusses how to go about doing so, but if you want a file for say
workQueueA
, then you can create a logging definition with a filename
/var/log/prefect-workqueueA.log
and so on for the other work-queues
k
But the setting is configured globally right ?
c
Copy code
Note that you'll need to use your custom logging configuration anywhere you want Prefect to log to the filesystem. This may include servers where you run Prefect Orion or a Prefect agent, or containers
it’s global per configuration, if you want per workqueue, then
flowA
would have tags and labels to go to
workQueue1
with a logging definition on that agent, and
flowB
with
workQueue2
should be configured to go to another agent with another definition