Multi-threaded log management method and multi-threaded log management device
A multi-threading and logging technology, applied in electrical digital data processing, special data processing applications, instruments, etc., can solve problems such as performance degradation, system waiting, and poor system real-time performance, and achieve the effect of avoiding system waiting and improving system performance.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0026] The embodiment of the present invention provides a multi-threaded log management method, such as figure 1 As shown, the method includes the following steps:
[0027] Step 101: Obtain the system file descriptor FD, writing level and writing content of the log written by the thread;
[0028] Before step 101, a log file creation process in the main thread is also included, and the process includes:
[0029] Setting attributes of the log object in the main thread, the attributes including the log file name of the log file;
[0030] Open or create a log file corresponding to the log file name;
[0031] A system file descriptor FD corresponding to the log file is set in the main thread.
[0032] Step 102: When the write level is greater than a preset level, write the written content into a log file corresponding to the FD.
[0033] Optionally, when the write level is greater than a preset level, obtain the current write time and the current thread number;
[0034] The reusable thread-safe...
Embodiment 2
[0045] Such as image 3 As shown, the embodiment of the present invention provides a schematic diagram of the overall structure of a multi-threaded log management and use mechanism, which mainly includes a file system, a log management module, and a log call (write) module. The file system, the log management module, and the log call (write) module are named according to the function of each module, which are different from the modules in the device used in the method of multithreaded log management in the present invention.
[0046] File system refers to the file that is recorded in the file system and viewed as subsequent logs. In the file system, each opened log file corresponds to an FD, and the file can be written, switched, etc. through the FD corresponding to the log file operating.
[0047] The log management module includes log object management, log creation, log writing, log switching, log configuration and other modules. According to the log configuration, the log mana...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com