The invention discloses a method for recording
log data, which comprises the following steps: A, predetermining the lengths of measurement periods and starting one measurement period; B, monitoring accumulated flow of the
log data in real time in the current measurement period; C, judging whether the accumulated flow of the
log data in the current measurement period is greater than a predetermined
throttle flow threshold, if so, stopping recording the log data which are recorded currently and are of the lowest level according to predetermined levels of the log data, starting a new measurement period and returning to execute the step B, if not, executing a step D; and D, judging whether a predetermined restoration condition is satisfied, if so, restoring to
record log data of all levels, if not, returning to execute the step B. By using the method provided by the invention, when a
communication device is in abnormal condition, the
retention time of the log data is prolonged effectively, thereby facilitating fault location of the
communication device.