Garrett Scholtes
04/03/2024, 9:21 PMPREFECT_LOGGING_EXTRA_LOGGERS
says "By default, Prefect won't capture log statements from libraries that your flows and tasks use" but it is unclear if "capture" means capture by the logger at all or whether those logs get sent to Prefect. Furthermore, I do not want any Flow or Task logs to be sent to Prefect but still want them to end up on the container's stdout so that they will get picked up by fluentbit (our log processor)Marvin
04/03/2024, 9:22 PMPREFECT_LOGGING_EXTRA_LOGGERS
affects this process.
The PREFECT_LOGGING_EXTRA_LOGGERS
environment variable is mentioned in the context of which loggers are captured by Prefect by default. However, the exact mechanism for ensuring that logs are not sent to Prefect Cloud and instead only output to standard output (stdout) is not detailed in the excerpts provided.
Since the direct documentation and issues search didn't yield the necessary specifics, I recommend exploring the Prefect community or support channels for more in-depth guidance. Configuring logging to ensure compliance with external log processors like fluentbit while avoiding cloud logging in Prefect might require a more nuanced approach or hands-on assistance from the Prefect team.
To get a more tailored answer, you may consider either filing a new GitHub issue in the Prefect repository to clarify this configuration or reaching out on the Prefect Slack community for real-time assistance. Here are the links to begin:
- Prefect GitHub Issues: Create a new issue
- Prefect Slack Community: Join the Slack Workspace
If you need further assistance or have other questions, feel free to ask.Nate
04/03/2024, 11:16 PMget_logger
instead of get_run_logger
Garrett Scholtes
04/04/2024, 3:24 PMGarrett Scholtes
04/04/2024, 3:29 PMAPILogHandler
as a handler? Like I notice that we have this bit in our logging.yml
handlers:
...
api:
level: 0
class: prefect.logging.handlers.APILogHandler
and some loggers that use the api setting:
loggers:
prefect:
level: "${PREFECT_LOGGING_LEVEL}"
prefect.extra:
level: "${PREFECT_LOGGING_LEVEL}"
handlers: [api]
prefect.flow_runs:
level: NOTSET
handlers: [api]
prefect.task_runs:
level: NOTSET
handlers: [api]
(a lot of this is from the default/sample logging.yml IIRC)
So instead we might be able to just set a different handler for these loggers, and possibly also configure the api handler to not use prefect.logging.handlers.APILogHandler
?Garrett Scholtes
04/09/2024, 6:54 PMSee the Python Logging configuration documentation for more information about the configuration options and syntax used byPython config docs was all I needed.logging.yml