Logging via a database
You may have heard of open-telemetry, or a range of dashboards such as Jaeger. However, at the time of writing this, a lot of the Rust libraries for such platforms lacking in documentation, maturity, and introducing breaking changes. To show you how to setup open telemetry and off the shelf dashboards would result in the book aging quickly. With the skills you have learnt in this book, there is nothing stopping you Googling the latest configuration steps to run these off the shelf projects. For the rest of this chapter, we are going to build our own async mechanism that shoots logs off to a database allowing you to query this database for specific logs. Our async mechanism is going to keep the pressure off the logging functionality directly as we log every request. If we had to await a response from the database for every request, we would slow down our request processing times down dramatically. Instead, we are going to shoot a log message off to an async actor...