Is there a way to get timestamps on the prefect ag...
# prefect-cloud
j
Is there a way to get timestamps on the prefect agent logs? We are running the agent on a windows server using nssm, and the STDERR appears to have no timestamps.
z
Hm there are timestamps in all of our default logging configs. Did you change the log format?
j
We do get timestamps on the logs that are shipped to prefect. But the STDERR from the prefect agent itself appears to have no timestamps. We have this environment variable set to affect the logs that go to prefect:
Copy code
SET "PREFECT_LOGGING_FORMATTERS_STANDARD_TASK_RUN_FMT=%(asctime)s.%(msecs)03d | %(levelname)-7s | %(task_name)s | %(message)s"
Here are the last three lines of STDERR captured in the logfile:
Copy code
<frozen runpy>:128: RuntimeWarning: 'prefect.engine' found in sys.modules after import of package 'prefect', but prior to execution of 'prefect.engine'; this may result in unpredictable behaviour
<frozen runpy>:128: RuntimeWarning: 'prefect.engine' found in sys.modules after import of package 'prefect', but prior to execution of 'prefect.engine'; this may result in unpredictable behaviour
<frozen runpy>:128: RuntimeWarning: 'prefect.engine' found in sys.modules after import of package 'prefect', but prior to execution of 'prefect.engine'; this may result in unpredictable behaviour
z
Those aren't logs, those are just warnings Python is emitting to stderr.
j
Okay, two questions: 1. Is it a heavy lift to get timestamps on those warnings emitted to stderr? 2. Is the warning important, or does everybody get this warning?
z
1. Yes that's not controlled by us and bypasses logging. We'd need to hook into all stderr which would be weird. 2. Not important. We want to fix it, but it has no effect so it's a low priority