Summary
In this chapter, we added logging to the server and learned how to activate the logger and set filters to it. After that, we transformed our unflexible server to a configurable microservice that can read settings from different sources—the configuration file, the environment variable, and the command-line parameters. We became familiar with The Twelve-Factor App methodology and used the dotenv crate, which helped us to read environment variables from a file. We also used the clap crate to add a command-line parser. Finally, we touched on the serde crate, which introduced us to the world of serialization.
In the next chapter we will learn how to use serde crate for needs of a microservices: to deserialize request and serialize responses ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access