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 to a certain format like JSON, CBOR, BSON, MessagePack, etc.