<@ULVA73B9P> - my py app has detailed logging (INF...
# ask-community
m
@Marvin - my py app has detailed logging (INFO level) when running on local but when I deploy the same file on prefect cloud. I get no logging at all. I have the variable in deployment file as below. What else i am missing to see the logs for runs in the cloud?
Copy code
"env": {"PREFECT_LOGGING_LEVEL": "INFO"},
m
To ensure that your logs appear in Prefect Cloud, consider the following: 1. Root Logger Configuration: By default, the root logger outputs logs at the WARNING level. You can override this by setting the
PREFECT_LOGGING_ROOT_LEVEL
environment variable to "INFO" in your deployment configuration. 2. Custom Logging Configuration: If you need more control, you can provide a custom
logging.yml
file. Place this file in your
PREFECT_HOME
directory to completely customize the logging behavior. 3. Verify Environment Variables: Double-check that your environment variables are correctly set in Prefect Cloud. Ensure that
PREFECT_API_URL
and
PREFECT_API_KEY
are correctly configured to connect to Prefect Cloud. For more information, you can refer to the Prefect Logging Documentation. If these steps do not resolve the issue, it might be worth checking if there are any errors or misconfigurations in your Prefect Cloud setup.
m
I have these 2 variables but still absolutely zero logs, flows running fine in the cloud but absolutely no logs. I get detailed logging when running local. @Marvin
Copy code
"env": {
                        "PREFECT_LOGGING_LEVEL": "INFO",
                        "PREFECT_LOGGING_ROOT_LEVEL": "INFO"
                    },
m
It seems you've configured the logging levels correctly, but there are still no logs in Prefect Cloud. Here's what you can check: 1. Infrastructure Issues: Ensure there are no infrastructure issues preventing your flow from starting. Check the worker logs for any indications of problems. 2. Worker Environment: Logs are generally available where the worker is running. Ensure that the logging settings are correctly propagated from the worker environment to the flow run environment. 3. Debug Level: Temporarily set the logging level to DEBUG to gather more detailed logs and identify any issues. You can do this by setting
PREFECT_LOGGING_LEVEL
and
PREFECT_LOGGING_ROOT_LEVEL
to "DEBUG". Remember to switch back to INFO once resolved. 4. Authentication: Verify that your
PREFECT_API_URL
and
PREFECT_API_KEY
are correctly configured. Ensure they match the Prefect Cloud workspace you are using. For more guidance, you can refer to the Prefect Cloud Troubleshooting Documentation.