https://dagster.io/ logo
#dagster-cloud
Title
# dagster-cloud
a

Abhishek Agrawal

02/22/2023, 1:25 PM
Is it possible to see the output of print statements from the dagster code that has been deployed to Dagster Cloud via k8s agent?
z

Zach P

02/22/2023, 2:48 PM
You may be interested in reading about dagster logging. Additionally, most contexts will have their own ready to use logger built in. Its quite convenient. EG:
Copy code
@asset
def my_asset(context):
    <http://context.log.info|context.log.info>("Hello")
    ...
a

Abhishek Agrawal

02/22/2023, 10:11 PM
Thanks @Zach P. I am not able to see even these context logs anywhere. The code gets deployed but there's an error so the code location doesn't get added. I am deploying it via GKE and there are no logs on the k8s side too..
z

Zach P

02/22/2023, 10:12 PM
Ahhh, are you able to deploy it locally? (EG: Running dagit /
dagster dev
)?
a

Abhishek Agrawal

02/22/2023, 11:47 PM
yes locally it's all good.. I think I can even fix the error I'm getting but I was just curious if I will have access to logs on GKE and Dagster Cloud
z

Zach P

02/23/2023, 12:21 AM
May be worth crossposting to #dagster-kubernetes . Does the error not appear in the deployment panel? I’m running dagster-cloud so it may be a bit different.
d

daniel

02/23/2023, 2:15 AM
for now if you want to see process output while your code is being loaded, you'll need to look at the raw pod logs in kubernetes (there should be a pod with the name of your code location in it). We're working on getting those logs exposed in Dagit as well though. Logs from within your runs can be displayed in Dagit using the tools that Zach linked to
a

Abhishek Agrawal

02/23/2023, 2:16 AM
I was running the kubectl logs command but it only shows that dagster server is up.. no logs..
d

daniel

02/23/2023, 2:17 AM
Is it possible to share your code that isn't logging the way you expect it to, or a code snippet that reproduces the problem?
If I add a print statement in the module being loaded, I see it in the grpc server output: (I added a print("HELLO")
Copy code
HELLO
2023-02-22 20:18:47 -0600 - dagster - INFO - Started Dagster code server for module dagster_test.toys.repo on port 4000 in process 12784
a

Abhishek Agrawal

02/23/2023, 3:47 AM
hmm yeah that's how it works on local.. okay I will check again.. this was super helpful!
9 Views