Chapter 7. Configuration, logging, and deployment
In this chapter
- Using the configuration library
- Logging application-level events and debug messages
- Packaging and deployment of Akka-based applications
Thus far, we’ve focused on creating actors and working with the actor system. To create an application that can actually be run, we’ll need several other things to be bundled with it before it’s ready for deployment. First, we’ll dive into how Akka supports configuration, and then we’ll look at logging, including how you can use your own logging framework. Last, we’ll go through a deployment example.
Akka uses the Typesafe Config Library, which sports a state-of-the-art set of capabilities. The typical features are there: the ability to define properties in different ways and then reference them in the code (job one of configuration is to grant runtime flexibility by making it possible to use variables outside the code). There’s also a sophisticated means of merging multiple configuration files based on simple conventions that determine how overrides will occur. One of the most important requirements of a configuration system is providing a means of targeting multiple environments (such as development, testing, production), without having to explode the bundle. You’ll see how that’s done, as well.