Forums

No Log on Always on Tasks

Hi, Some of my Always on tasks gets no log.

2023-03-23 20:17:11 - Task preparing to start

I'm just getting this log. I added print to see if my code is working. But still no log.

And also i have another code that always works in task, it stopped giving logs after 9th march. I didn't change anything is it a general problem?

Task preparing to start message may mean that the task starts, finishes quickly and restarts. If you run the exact same command that you use for the task in a Bash console, do you see any logging? Regarding the second task, that stopped logging -- I understand that it was logging before, right? Could you do the same experiment with running it in a Bash console?

On bash console i am getting this log which i added print("System is working!!!") top of my code.

System is working!!!

And also i am running that code on my local machine and it's doing its job and generate logs but on Always on Task is not working or not generating log to understand what is wrong

See https://help.pythonanywhere.com/pages/AlwaysOnTasks/#stuff-that-you-print-doesnt-appear-in-the-log

with that code its working great. thanx a lot :)

python3.8 -u /path/to/script.py

Glad to hear that!