-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to stream output of services #185
Comments
I'm not sure what I did different, but I now see the error log. Closing for now. Will reopen if I can reproduce. |
Reopening. It's possible to see the output of a service, but only of the service exits. So long as that hasn't happened, then the output is not available. |
I can't reproduce. I've tried with the project file below, but the output comes properly streamed (both for stdin and stderr):
Can you share the service that you were running? |
Simple python code that retries connecting to a (non-existent) server: import requests
import time
def send_request(url):
url = f"{url}/tickle"
try:
response = requests.post(url)
print("Response Status Code:", response.status_code)
except requests.exceptions.ConnectionError as e:
print(e)
def main():
while True:
send_request("https://localhost:5000")
time.sleep(60)
if __name__ == "__main__":
session = requests.Session()
session.verify = False
main() When run on the command line using |
Hi I just saw this while driving by. Do you think the issue might be output buffering? I think Python line buffers when attached to a terminal but otherwise aggressively buffers stdout and stderr. Could be worth trying |
Say I run a service called
tickle
that immediately prints an error but does not terminate. If I do so usingnix .#start-services start
, then all I see is:I don't see the error message until the service stops. If it doesn't stop unless I SIGTERM on the terminal, then the output is lost.
The text was updated successfully, but these errors were encountered: