Using Ring Buffer Logging to Help Find Bugs
Brian Marick · 2000
This paper contains a set of related patterns. All the patterns are concerned with how you, a programmer, get the information you need to understand and fix a software bug. The solutions revolve around the use of a ring buffer to log key events in the life of a system. A ring buffer is a buffer with a fixed size. When it fills up, adding another element overwrites the first. The picture to the right shows a ring buffer that can hold eight pieces of data. Nine have been added. The ninth overwrote the first. When another is added, it will overwrite the second. These patterns have two themes: 1. Be considerate of the users. 2. Over time, evolve a system's logging to make debugging efficient.