<@ULVA73B9P> I am using `prefect shell watch ....`...
# ask-marvin
o
@Marvin I am using
prefect shell watch ....
to run some commands. In the prefect dashboard i think i only see the stdout from the command not stderr. Do I need to explicitly tell it to capture stderr as well somehow? if so how?
m
The Prefect documentation does not explicitly mention capturing
stderr
when using the
prefect shell watch
command. However, typically in shell environments, both
stdout
and
stderr
can be redirected or captured together using shell redirection techniques. To capture both
stdout
and
stderr
, you can modify your shell command to redirect
stderr
to
stdout
using
2>&1
. This way, both outputs will be combined and should be visible in the Prefect dashboard. For example, if your original command is:
Copy code
shell
prefect shell watch <your_command>
You can modify it to:
Copy code
shell
prefect shell watch '<your_command> 2>&1'
This will ensure that both
stdout
and
stderr
are captured together. You can find more information about executing shell commands with Prefect in the Prefect Shell documentation.