Skip to content
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

Change default stream to stdout for truss logs. #328

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

squidarth
Copy link
Collaborator

@squidarth squidarth commented Jun 5, 2023

Log truss logs to stdout instead of stderr

Testing

Tested with this command:

$ poetry run truss predict --target_directory examples/truss-public-gh-repo-test --request '{"inputs": [1]}' 

Using the truss in this repo:

This command spins up a docker containerBefore change, output all goes to stderr

$ docker logs 94837b306b92 > /dev/null
{"asctime": "2023-06-06 00:43:12,755", "levelname": "INFO", "message": "Setting max asyncio worker threads as 6"}
{"asctime": "2023-06-06 00:43:12,756", "levelname": "INFO", "message": "starting uvicorn with 1 workers"}
{"asctime": "2023-06-06 00:43:12,801", "levelname": "INFO", "message": "Executing model.load()..."}
{"asctime": "2023-06-06 00:43:12,802", "levelname": "INFO", "message": "Application startup complete."}
{"asctime": "2023-06-06 00:43:12,804", "levelname": "INFO", "message": "Completed model.load() execution in 3 ms"}
{"asctime": "2023-06-06 00:43:13,715", "levelname": "INFO", "message": "172.17.0.1:53630 - \"POST /v1/models/model%3Apredict HTTP/1.1\" 200"}

After change, now goes to stdout, nad gets eaten by /dev/null

$ docker logs 30f32f99b63f > /dev/null
$

@squidarth squidarth merged commit e59bb17 into main Jun 6, 2023
3 checks passed
@squidarth squidarth deleted the sshanker/truss-logs-to-stdout branch June 6, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants