Traces and Logs as 2-categories

In the past, we looked at software traces and logs as semigroups or monoids as a single object category. In the latter case, the monoid object is a trace or log, and arrows (morphisms) are trace and log messages.

However, we can look at the traces and logs from another perspective. First, the monoid object is a system we trace, and messages are arrows. Then arrows between messages become arrows between arrows (2-morphisms) in a 2-category (see also).

Therefore, we suggest looking at software traces and logs as 2-categories. Some forthcoming trace and log analysis patterns will use such a metaphor. For example, it provides some theoretical justification for the vertical and horizontal composition of traces and logs.

The horizontal composition type also allows the so-called whiskering.