Hi everyone, I'm attempting to point logs from int...
# ask-community
j
Hi everyone, I'm attempting to point logs from internal libraries that are propagated to the root logger to the Prefect Server and UI. I've configured the following setting:
Copy code
PREFECT_LOGGING_ROOT_LEVEL=INFO
When I do this, my library's logs are picked up by Prefect console logger and are logged to a terminal, including the Prefect formatting/coloring/etc. However, these logs are not sent to the Prefect Server or available in the UI. Running this command:
Copy code
prefect flow-run logs <FLOW_RUN_ID>
Returns a smaller subset of the logs that appeared in my console, seeming only to log default logs from Prefect or those explicitly passed into the Prefect logger fetched with get_run_logger(). (It shows the same logs that appeared in the console before setting PREFECT_LOGGING_ROOT_LEVEL=INFO) Any input on how I can send third party logs to the Prefect Server and UI?
n
hi @Jonah Duffin - the setting for this is
PREFECT_LOGGING_EXTRA_LOGGERS
which you'd set like
Copy code
export PREFECT_LOGGING_EXTRA_LOGGERS=pytorch,requests
etc
j
Hi @Nate, I have tried this setting among several others and the result is the same. The logs show up in my console logger but not the Prefect API logger. Here's everything I have tried:
Copy code
PREFECT_LOGGING_ROOT_HANDLERS="[api]"
PREFECT_LOGGING_LEVEL=INFO
PREFECT_LOGGING_HANDLERS_API_LEVEL=INFO
PREFECT_LOGGING_EXTRA_LOGGERS=library1,library2
PREFECT_LOGGING_SERVER_LEVEL=INFO