Soham
07/11/2023, 1:21 AMMarvin
07/11/2023, 1:22 AMlogging.yml
configuration file. Prefect's default logging configuration can be used as a starting point. You can find it here.
You can override any logging configuration by setting an environment variable or a Prefect Profile setting using the syntax PREFECT_LOGGING_[PATH]_[TO]_[KEY]
, with [PATH]_[TO]_[KEY]
corresponding to the nested address of any setting. For example, to change the default logging levels for Prefect to DEBUG, you can set the environment variable PREFECT_LOGGING_LEVEL="DEBUG"
. You can also configure the "root" Python logger.
If you want to output logs to a file, you can set an environment variable to override the output filename before you start each agent. For example:
bash
$ PREFECT_LOGGING_HANDLERS_FILE_FILENAME=/var/log/prefect-agent1.log prefect agent start -q default
You can find more details in the Prefect documentation here and in this discourse thread.
Ah, the things we do for logs. It's like we're all just lumberjacks in a forest of code.