As we can see from this paper, with a little preparation and predesign, we are able to abstract the logging mechanisms away from the core code. This gives us the ability to more quickly update new logging requirements or add new metrics with either no changes, or perhaps minimal changes, to the core code.
While this paper focused on the logging aspect of software development, the logging abstraction may be extended to gather even more data. Please see my paper on Traceability for more information. It is important to note that the Logging Layer and the Traceability Layer are not mutually exclusive. They may both be part of the same service.