Diogo Ferreira
01/31/2025, 6:24 PMMarvin
01/31/2025, 6:25 PMlogging.yml
file.
Here's a concise approach to achieve this:
1. Modify `logging.yml`: Update the formatter
section in your logging.yml
file to use a JSON formatter. This typically involves specifying a JSON format string.
2. Environment Variables: If you prefer not to use a logging.yml
file, you can set the format via environment variables that Prefect uses to configure logging.
For more detailed guidance, you can refer to the Prefect Logging Documentation.
If you need further assistance with the exact configuration or syntax, please let me know!Diogo Ferreira
01/31/2025, 6:25 PMMarvin
01/31/2025, 6:25 PMlogging.yml
file with JSON formatting.
For more specific instructions, you may need to consult Prefect's support or documentation related to Prefect Cloud configurations. You can start by exploring the Prefect Cloud Troubleshooting Guide for additional guidance.
If you have more specific requirements or constraints, feel free to share them!Nate
01/31/2025, 6:28 PMDiogo Ferreira
01/31/2025, 6:29 PMlogger = get_run_logger()
and it is using the https://github.com/PrefectHQ/prefect/blob/main/src/prefect/logging/logging.yml#L11
"standard", I'd like it to use "json"Nate
01/31/2025, 6:31 PMDiogo Ferreira
01/31/2025, 6:32 PMNate
01/31/2025, 6:38 PMPREFECT_LOGGING_{PATH}_{TO}___{CONFIG}
» PREFECT_LOGGING_HANDLERS_CONSOLE_FORMATTER=json uvx prefect worker start --pool local
Discovered type 'process' for work pool 'local'.
Worker 'ProcessWorker 81fb3946-021f-41b5-893d-670bbc02a665' started!
{"name":"prefect.flow_runs.worker","msg":"Worker 'ProcessWorker 81fb3946-021f-41b5-893d-670bbc02a665' submitting flow run '27dbc9b6-9666-40bb-b746-80b4e33e29fd'","args":[],"levelname":"INFO","levelno":20,"pathname":"/Users/nate/Library/Caches/uv/archive-v0/A278kD7gqcA3TRYQZ-5FO/lib/python3.12/site-packages/prefect/workers/base.py","filename":"base.py","module":"base","exc_info":null,"exc_text":null,"stack_info":null,"lineno":906,"funcName":"_submit_scheduled_flow_runs","created":1738348616.1268811,"msecs":126.0,"relativeCreated":27761.27529144287,"thread":8487322176,"threadName":"MainThread","processName":"MainProcess","process":99821,"taskName":"functools","flow_run_name":"shapeless-markhor","flow_run_id":"27dbc9b6-9666-40bb-b746-80b4e33e29fd","flow_name":"<unknown>","worker_name":"ProcessWorker 81fb3946-021f-41b5-893d-670bbc02a665","work_pool_name":"local","work_pool_id":"c0f5296e-8607-4e2d-9fee-36a5f10af95f","worker_id":"0d03f6ef-c95d-487f-acc4-270562d91ddb","message":"Worker 'ProcessWorker 81fb3
Diogo Ferreira
01/31/2025, 6:41 PM