1. A computer-readable storage medium having computer-executable instructions which when executed perform a method for determining an order for a plurality of traces, the method comprising: modeling the lifecycle of a distributed system as an abstract state machine having a set of states and transitions between the states that correspond to events that occur in the distributed system; adding trace statements to program code of the distributed system, wherein each trace statement corresponds to an event that occurs in the distributed system such that upon a trace statement being executed by a processor, the trace statement generates a trace that includes an indication that that the corresponding event has occurred; recording each generated trace in one of one or more log files; receiving the one or more log files containing the generated traces; upon receiving the one or more log files, initializing the abstract state machine to a current state; for each of the traces in the one or more log files, performing steps (1)-(3): (1) selecting the trace; (2) determining that the event indicated by the trace is an event that advances the abstract state machine from the current state to a next state; and (3) upon determining that the event indicated by the trace advances the abstract state machine, storing the trace in an interleaving that indicates a correct ordering of the traces, and advancing the state of the abstract state machine to the next state; after performing steps (1)-(3) for each of the traces in the one or more log files, examining the interleaving to determine whether the number of traces in the interleaving equals the total number of generated traces in the one or more log files; and upon determining that the number of traces in the interleaving equals the total number of generated traces, indicating that the correct interleaving of the traces was found.