Federico Zambelli
04/10/2023, 4:28 PMlog_prints=True
, as well as get_run_logger
, and neither case worked. What am I missing?
for the record, this is my .py module:
from prefect import flow, get_run_logger
@flow(log_prints=True)
def hi():
logger = get_run_logger()
logger.warning("Hit from Prefect! 😅")
if __name__ == "__main__":
hi()
Will Raphaelson
04/10/2023, 4:32 PMprefect version
?Federico Zambelli
04/10/2023, 4:32 PMprefect
on the same system but with a local orion server?Will Raphaelson
04/10/2023, 4:34 PMFederico Zambelli
04/10/2023, 4:36 PMWill Raphaelson
04/10/2023, 4:37 PMFederico Zambelli
04/10/2023, 4:37 PMNate
04/10/2023, 4:37 PMlog_prints=True
and print
instead of logger.warning
?Will Raphaelson
04/10/2023, 4:38 PMNate
04/10/2023, 4:40 PMFederico Zambelli
04/10/2023, 4:40 PMlog_prints
• logger without log_prints
• print with log_prints
All of them logging two separate messages. None of them showing up in the UINate
04/10/2023, 4:42 PMIn [8]: import prefect
In [9]: prefect.settings.PREFECT_LOGGING_TO_API_ENABLED.value()
Out[9]: True
Federico Zambelli
04/10/2023, 4:44 PMTrue
yesWill Raphaelson
04/10/2023, 4:48 PMprefect config set PREFECT_API_URL=<http://127.0.0.1:4200/api>
prefect server start
as well, before switching the config value. You can also create a profile for quick switching. https://docs.prefect.io/latest/concepts/settings/#configuration-profilesFederico Zambelli
04/10/2023, 4:50 PMNate
04/10/2023, 4:54 PMFederico Zambelli
04/10/2023, 4:54 PMINFO
first, then as I saw no logs happening I switched to WARN
to tryWill Raphaelson
04/10/2023, 4:57 PMFederico Zambelli
04/10/2023, 4:57 PMWill Raphaelson
04/10/2023, 5:08 PMFederico Zambelli
04/10/2023, 5:09 PMWill Raphaelson
04/10/2023, 5:10 PMFederico Zambelli
04/10/2023, 5:16 PMWill Raphaelson
04/10/2023, 5:16 PMFederico Zambelli
04/10/2023, 5:16 PM.prefect
folder in home in Windows, and let prefect recreate it, but nonetheless I see no logs. 🤔 🤔 🤔 🤔Will Raphaelson
04/10/2023, 5:39 PMFederico Zambelli
04/10/2023, 5:41 PMWill Raphaelson
04/10/2023, 5:42 PMFederico Zambelli
04/10/2023, 5:42 PMprofiles.toml
Will Raphaelson
04/10/2023, 5:47 PMFederico Zambelli
04/10/2023, 5:47 PMprefect cloud login
, authenticated via browser, ran python my_flow.py
, that's itWill Raphaelson
04/10/2023, 5:56 PMFederico Zambelli
04/10/2023, 5:58 PMWill Raphaelson
04/10/2023, 5:58 PMRyan Peden
04/10/2023, 7:53 PMprefect config set PREFECT_DEBUG_MODE=True
to get a deeper look at what's going on.
Specifically, you should see messages from prefect.logging.handlers.APILogWorker
. First, you should see one like enqueueing item {'name': 'prefect.flow_runs', 'level': 30, 'message': 'Hit from Prefect! 😅' ...timestamp and ID fields }
And then another one a bit later that looks the same except instead of enqueueing item
it will say added item
. It seems like the flow itself is able to make API calls to create the flow and report its completion, but APILogWorker
isn't sending anything to the API.
It would be interesting to see if the log worker reports any problems. Even if it doesn't report any problem, that would be a useful clue as well! 🔎Federico Zambelli
04/10/2023, 11:07 PMRyan Peden
04/10/2023, 11:14 PMWill Raphaelson
04/10/2023, 11:21 PMFederico Zambelli
04/11/2023, 7:39 AMWill Raphaelson
04/11/2023, 3:37 PMFederico Zambelli
04/11/2023, 3:38 PMWill Raphaelson
04/11/2023, 3:38 PMFederico Zambelli
04/11/2023, 3:39 PM