Log generation method and apparatus
2015
The present invention is applicable to the technical field of information and provides a log generation method and apparatus. The method comprises: when receiving a log generation request, obtaining to-be-written log data, and caching the log data into a circular queue; and according to a cache space of the circular queue, reading the log data from the circular queue, and writing the log data into a memory in a preset manner so as to generate a log file. According to the method and the apparatus, a locking mechanism does not exist between an obtaining process and a writing process of the log data, so that the generating efficiency of the log file is efficiently improved and a guarantee is provided for efficient operation of an operational system.
- Correction
- Source
- Cite
- Save
- Machine Reading By IdeaReader
0
References
0
Citations
NaN
KQI