Hi there. I have a flow that will run on Kubernetes. I'd like to see log messages in near real time. Currently, the messages show at the end of the run? I wonder if this has to do with the stream not being flushed frequently. How can I flush the stream after calling
<http://logger.info|logger.info>()
? Thanks!
n
nicholas
07/12/2021, 11:31 PM
Hi @Pedro Machado - this isn't really possible because of how logs are batched; if your run is fairly short there's a good chance logs will always show up after the run has completed
p
Pedro Machado
07/12/2021, 11:39 PM
Thanks, Nicholas. Would it be different in a long running flow? We'll have some of those and I want to make sure that we don't have to wait hours to see what's happening.
n
nicholas
07/12/2021, 11:42 PM
I would run a test if possible to confirm but since batching happens at some interval you should logs show up regularly, not just at the end of the run
p
Pedro Machado
07/12/2021, 11:47 PM
Actually, the messages are showing in Prefect cloud as they are issued. The issue is with
prefect run --project myproject -n "myflow" --watch
They don't show in real time. Am I missing another option?
n
nicholas
07/13/2021, 12:02 AM
I don't think so, are you still seeing them only after the run has completed?
p
Pedro Machado
07/13/2021, 2:08 AM
Correct.
I see
Copy code
Task 'hello_task': Starting task run...
And then it stays there until the flow finishes and at that time, it shows the remaining log entries.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.