Blake
03/03/2024, 4:11 PMlogging.yml
file in my docker work pool hosted in ECS. In my dockerfile, I am copying the logging.yml file into the cwd and setting the env variable PREFECT_LOGGING_SETTINGS_PATH
pointing to the file. Running a flow in this environment results in no prefect logs being produced, indicating something is malformed in my logging configuration. I think that this is because of the class
key in the custom handler I have added in my logging.yml not being found. The class is located at utils.memory_log_handler.MemoryLogHandler
, relative to the root of the codebase being cloned where my flow code lives. What adjustments need to be made in order to get my custom log configuration working correctly?Marvin
03/03/2024, 4:13 PMPREFECT_LOGGING_SETTINGS_PATH
environment variable is set correctly to the path of your logging.yml
file within the Docker container. This variable should provide the full path to the file as it resides within the container's file system.
2. Double-check that your custom logging handler class, utils.memory_log_handler.MemoryLogHandler
, is defined correctly and can be imported without issues. As you mentioned, it is relative to the root of the codebase, so your working directory in the Docker container should be set accordingly.
3. Make sure the custom handler class is available to the Python environment within the Docker container. This may involve adjusting the PYTHONPATH
environment variable or modifying the Dockerfile to install any necessary packages or code.
4. Review your logging.yml
file to confirm that the handler configuration is correct. Ensure you're specifying the full import path for the custom handler class under the class
key.
5. Check if there are any relevant GitHub issues or documentation updates regarding custom log handlers. From the search results, it appears there are some issues and feature requests related to logging (#6767, #7509), so you might want to verify that your use case is not affected by any ongoing changes or bugs.
6. If you're experiencing difficulties with logs after updating Prefect to a newer version, it might help to look into issues such as #9532 for any potential troubleshooting steps or fixes.
You may refer to Prefect's logging guide for more information on logging configurations.
If these steps do not resolve the issue, it may be helpful to examine the logs from Prefect's components (e.g., server and agent) to find any error messages or warnings related to logging or handler loading. This information may provide additional clues as to what could be going wrong with your custom logging configuration.