Many times, you need to view the latest log entries generated by your app to check that everything is working or see what is currently broken. We created a FastAPI app that will stream our latest log files entries over websockets. The blog post with more detail is available here:
main.py
: FastAPI web server using uvicorn. Contains the log viewer page and websocket endpoints.log-generator.py
: Random log entry generator used for testing purposes.templates/index.html
: Log viewer page (client) which established websocket connection to server (main.py
).
The dependencies and virtual environment details are located in the Pipfile
which can be used with pipenv
.
GNU GPL v3