hagai
06/19/2024, 12:36 PMlog_prints=True
in the flow decoratorMarvin
06/19/2024, 12:36 PMINFO
, ERROR
). If your script logs at a lower level (like DEBUG
), those logs might not be captured.
2. Root Logger Configuration: If you're using the root logger or other custom loggers, make sure their propagation is not disabled, which would prevent logs from reaching the Prefect handlers.
Here are a few examples of setting up the logging configurations:
### Setting Environment Variables
bash
export PREFECT_LOGGING_LEVEL="DEBUG"
export PREFECT_LOGGING_ROOT_LEVEL="DEBUG"
### Custom Logging Configuration File
You can also customize logging by creating a logging.yml
file and setting the logging configurations there. Here is an example snippet for a custom `logging.yml`:
yaml
version: 1
disable_existing_loggers: False
formatters:
simple:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
handlers:
console:
class: logging.StreamHandler
level: DEBUG
formatter: simple
api:
class: prefect.logging.handlers.PrefectHandler
level: DEBUG
loggers:
# Python's root logger
"":
level: DEBUG
handlers:
- console
- api
# Your custom logger, if any
my_custom_logger:
level: DEBUG
handlers:
- console
- api
propagate: True
### Important References
- Prefect Logging Guide
If you still do not see logs in the Prefect UI after trying out these configurations, please review the Prefect logging settings and make sure your script loggers' configurations do not prevent logs from being captured by Prefect.
If you need specific examples or further help, feel free to ask!hagai
06/19/2024, 12:38 PMPREFECT_LOGGING_ROOT_LEVEL