<@ULVA73B9P> how do I ensure that all levels of lo...
# ask-marvin
d
@Marvin how do I ensure that all levels of logging are captured in prefect logs including debug level logs? I am using prefect 2.19
m
To capture all levels of logging, including debug-level logs in Prefect 2.19, you need to adjust the logging configuration. You can achieve this by setting an environment variable to change the default logging levels. Here's how you can do it: Set the environment variable
PREFECT_LOGGING_LEVEL
to
"DEBUG"
to ensure that all debug-level logs are captured:
Copy code
bash
export PREFECT_LOGGING_LEVEL="DEBUG"
Alternatively, you can use a Prefect Profile setting to achieve the same effect. When you set this variable, it instructs Prefect to log at the DEBUG level across all components. More details can be found in the Prefect 2.x logging guide.
d
@Marvin list all the logging levels that are displayed in prefect logging if no PREFECT_LOGGING_LEVEL is set
m
By default, if no
PREFECT_LOGGING_LEVEL
is set, the root logger in Prefect is configured to display logs at the
WARNING
level and above. This means that out-of-the-box, Prefect will show logs for the following levels: 1. WARNING: Default level if not explicitly set otherwise. 2. ERROR: Logs that indicate a more severe problem than warnings, typically leading to some form of failure. 3. CRITICAL: Logs that indicate a very serious problem that has caused or will lead to application failure. These log levels help in ensuring that important messages related to the performance of the workflow get attention. You can read more about Prefect's logging configurations in their official logging guide.