Logging & Meta Tests
Define the operations being done by the application as discrete units of work. Examples: commands, queries, startup, shutdown. Define explicit boundaries between units of work. This makes it easy to log the operations of the application.
- Log startup scenario together with settings. I.e. read all settings at application startup, and only there.
- Log commands and queries. For commands, log command type and eventual return value. For queries, log the query type and the query result.
- Define a logging gateway with convenience methods for logging application events. Define a class that represents an application event and define all known application events in a single, static and application-specific, class. Application events are lower-level than business events. For example: ExecutingCommand, CommandResult, Starting, Started, ShuttingDown, BeginRequest, EndRequest.
- Application events should have their own event id.
- Build infrastructure layer that takes care of applicat