1. A computer program product comprising a computer useable medium having a computer readable program, wherein the computer readable program when executed on a computer causes the computer to: monitor program activity occurring during execution of a computer program; collect trace data representative of the program activity; write, after the collecting the trace data reaches a predetermined point, the trace data to one or more trace records in a trace history buffer located in a volatile memory, each of the one or more trace records including a trace level associated therewith, the trace level indicating a severity of the program activity, the trace history buffer being a circular buffer such that oldest trace records are overwritten by newest trace records in a cyclical manner if the trace history buffer becomes full; compare, for each trace record stored in the trace history buffer, the trace level to a predetermined threshold value, and writing the trace record to a log file located in persistent storage as a logged trace record if the trace level is greater than the predetermined threshold value; write each remaining trace record stored in the trace history buffer to the log file if (i) at least one of the trace records is written to the log file as the logged trace record and (ii) a trap value specific to a process from a plurality of processes in the program activity is detected within the logged trace record; write the trace history buffer to the log file if the trap value specific to the program activity fails to be detected, and if the trace level associated with the logged trace record is subsequently determined to be greater than a predetermined trace history level; upon writing the trace history buffer to the log file, resize the trace history buffer if a quantity of the one or more trace records in the trace history buffer exceeds a predetermined number of trace records; and reset and clear the trace history buffer such that storing of trace records may continue.