https://prefect.io logo
m

Mahesh

12/08/2022, 6:22 AM
Hi Team, How to get flow logs using command line in prefect2? In prefect1 we can use
prefect get
command to get logs.
1
r

redsquare

12/08/2022, 7:38 AM
They are not available yet in the cli sadly
m

Mahesh

12/08/2022, 1:16 PM
yep, that's what I've discovered as well.
Can a member of the Prefect Team confirm this?
1
p

Peyton Runyan

12/08/2022, 2:10 PM
Hey @Mahesh you can see all available commands with
prefect --help
and you can run
--help
on any individual command to explore them. It's not currently available via the CLI. The closest you've got is
prefect flow-run inspect
which will give you the state
m

Mahesh

12/08/2022, 2:12 PM
@Peyton Runyan Will this be included in a future release?
p

Peyton Runyan

12/08/2022, 2:22 PM
It doesn't look like we have an enhancement request for it, so the best way to get eyes on it would be to create an issue for a feature enhancement. It seems like a reasonable request, so once we got a request for it and a bit of free time relative to high-priority features, it seems likely that this would make it out in a future release. https://github.com/PrefectHQ/prefect/issues/new/choose
r

redsquare

12/08/2022, 2:27 PM
the docs actually say its possible
closest issue I could find was allow the realtime stream of the log via the cli
m

Mahesh

12/08/2022, 2:28 PM
@Peyton Runyan thanks for the confirmation and I have created below feature request, https://github.com/PrefectHQ/prefect/issues/7814
🙏 2
r

redsquare

12/08/2022, 2:28 PM
👀 2
p

Peyton Runyan

12/08/2022, 2:32 PM
huh... I'll dig into that. The API you can do for sure.
I think that's a mistake in the docs. The method for getting the logs is
client.read_logs
. Our CLI pretty much just calls the client. We don't call the method anywhere in our codebase
t

terrence

12/08/2022, 2:38 PM
This is a mistake in the docs. It will be fixed in the next release.
👍 3
🙏 1
s

Serina

12/28/2022, 7:39 PM
@Mahesh @redsquare This enhancement should be released tomorrow
👍 1
4 Views