CN115658634A - Method for quickly positioning problems according to log information - Google Patents
Method for quickly positioning problems according to log information Download PDFInfo
- Publication number
- CN115658634A CN115658634A CN202211372278.2A CN202211372278A CN115658634A CN 115658634 A CN115658634 A CN 115658634A CN 202211372278 A CN202211372278 A CN 202211372278A CN 115658634 A CN115658634 A CN 115658634A
- Authority
- CN
- China
- Prior art keywords
- log
- pointer
- code
- quickly
- log information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
The invention discloses a method for quickly positioning problems according to log information, which comprises the following steps: marking at the code using a pointer, and separately storing the pointer marking the specific location using a log file; the corresponding code position is obtained by referring to the position pointed to by the pointer. According to the quick log positioning scheme, the log file is stored by using the B + tree in a double-pointer mode, the specific position of the code is quickly positioned according to the log information, the development efficiency of a user is greatly improved, and the development time and the development cost are saved.
Description
Technical Field
The invention relates to the technical field of code problem positioning, in particular to a method for quickly positioning problems according to log information.
Background
When a problem occurs, a programmer usually solves the problem by looking up a log. However, when the amount of codes is too large or the codes of other people are taken over, the information in the log is difficult to locate to a specific position in the codes at the first time, and sometimes a great amount of time is spent on locating the specific position of the problem in the codes. Therefore, a scheme for quickly locating the position of the code through log information is designed.
Disclosure of Invention
The invention aims to provide a method for quickly positioning problems according to log information, which aims to solve the problems in the background art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method for quickly positioning problems according to log information comprises the following steps:
marking at the code using a pointer, and separately storing the pointer marking the specific location using a log file;
the corresponding code position is obtained by referring to the position pointed to by the pointer.
In some embodiments, the log file is stored using a data structure of a B + tree.
In some embodiments, the non-leaf nodes of the data structure of the B + tree only contain navigation information and do not contain actual values, and all leaf nodes and connected nodes are connected using a linked list.
In some embodiments, the pointer records the location of the code printed using the log, as well as various parameters and specific values in the log.
The method for quickly positioning the problem according to the log information has the advantages that the method is not limited to the following steps:
according to the quick log positioning scheme, the log file is stored by using the B + tree in a double-pointer mode, the specific position of the code is quickly positioned according to the log information, the development efficiency of a user is greatly improved, and the development time and the development cost are saved.
Drawings
FIG. 1 is a diagram illustrating a pointer-based code position demonstration, wherein a log file only stores the pointer position, log contents are stored in other files, and the corresponding log contents are placed at the same position of the pointer of the file for convenience of demonstration;
FIG. 2 is a data structure representation of a B + tree, in which each node in the B + tree stores only the memory address of the data, so as to facilitate the computer to read the content quickly;
FIG. 3 is a flow chart of a log search for code location.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, technical solutions in embodiments of the present application are described in more detail. The described embodiments are a subset of the embodiments in the present application and not all embodiments in the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
A method for quickly locating a problem according to log information according to embodiments of the present application will be described in detail below with reference to fig. 1 to 3. It should be noted that the following examples are merely illustrative of the present application and are not to be construed as limiting the present application.
As shown in fig. 1-3, a method for quickly locating a problem according to log information, marks a code using a pointer, and separately stores the pointer marking a specific location using a log file; the corresponding code position is obtained by referring to the position pointed to by the pointer.
In a large number of codes, each line of specific code has a specific area in a stored file, the code is marked by using a pointer, and the pointers marking specific positions are separately stored by using a log file. When needed, the position pointed by the pointer can be consulted, and the corresponding code position can be obtained. See figure 1 for details.
The B + tree data structure is used as a data structure for storing a plurality of common database data, people can conveniently and quickly search when storing structured data, and particularly, the searching efficiency is higher than that of direct query by several orders of magnitude for a large amount of data. Such data structures may be employed to store the specific locations and contents of these logs. The non-leaf nodes of the B + tree only contain navigation information and do not contain actual values, and all the leaf nodes are connected with the connected nodes by using linked lists, so that the interval searching and traversing are facilitated. Because the B + tree does not contain data information on the internal nodes, more keys can be stored in the memory pages, the data storage is tighter, better spatial locality is realized, and therefore, better cache hit rate is realized when the data associated with the leaf nodes are accessed. The specific contents of the B + tree data structure are shown in fig. 2.
Log positioning method
When a log is designed to be printed in the Java development process, lots of Slf4J middleware is used for printing the log, codes are highlighted when the log is printed, and therefore the log printing position can be found quickly. The code of the method using the print log is set as a pointer, stored in a temporary file of the log file, and the pointer records the position of the code printed using the log, and various parameters and specific values in the log. Therefore, in subsequent positioning, a required log pointer can be quickly found in the log file through the value of the parameter, so that the specific position of the code is positioned for further modification or other operations.
Pointer file storage design
The positioning pointer is used as the key for searching the code position, and needs a separate file for storage, so that the log positioning position can be conveniently and quickly searched and modified. The stored pointer must be stored in the memory because the log needs to be updated automatically after the log is changed, and the corresponding content of the pointer file, namely the position and information of the log, needs to be updated automatically. The storage information of the pointer can be processed by adopting a data structure of a B + tree, the B + tree is used as a data storage data structure of commonly used databases such as mysql and the like, the data position to be searched can be quickly positioned, the space occupied by the data is small, and the memory is saved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.
Claims (4)
1. A method for quickly positioning problems according to log information is characterized by comprising the following steps:
marking at the code using a pointer, and separately storing the pointer marking the specific location using a log file;
the corresponding code position is obtained by referring to the position pointed to by the pointer.
2. The method of claim 1, wherein the log file is stored in a data structure of a B + tree.
3. The method of claim 2, wherein the non-leaf nodes of the data structure of the B + tree contain only navigation information and no actual values, and all leaf nodes and connected nodes are linked using a linked list.
4. The method for quickly locating problems according to log information of claim 2, wherein the pointer records the position of the code printed by using the log, and various parameters and specific values in the log.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211372278.2A CN115658634A (en) | 2022-11-03 | 2022-11-03 | Method for quickly positioning problems according to log information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211372278.2A CN115658634A (en) | 2022-11-03 | 2022-11-03 | Method for quickly positioning problems according to log information |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115658634A true CN115658634A (en) | 2023-01-31 |
Family
ID=84995272
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211372278.2A Pending CN115658634A (en) | 2022-11-03 | 2022-11-03 | Method for quickly positioning problems according to log information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115658634A (en) |
-
2022
- 2022-11-03 CN CN202211372278.2A patent/CN115658634A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5682524A (en) | Databank system with methods for efficiently storing non-uniform data records | |
US7529726B2 (en) | XML sub-document versioning method in XML databases using record storages | |
JP2632092B2 (en) | Apparatus and method for generating database | |
US7293006B2 (en) | Computer program for storing electronic files and associated attachments in a single searchable database | |
CN102890722B (en) | Indexing method applied to time sequence historical database | |
CA2412318A1 (en) | Method and apparatus for efficient management of xml documents | |
US20030037037A1 (en) | Method of storing, maintaining and distributing computer intelligible electronic data | |
CA2557406A1 (en) | Time-addressed database management system | |
EP2336901B1 (en) | Online access to database snapshots | |
CN110109910A (en) | Data processing method and system, electronic equipment and computer readable storage medium | |
US8161051B2 (en) | Method and apparatus for data processing with index search | |
US6826563B1 (en) | Supporting bitmap indexes on primary B+tree like structures | |
AU664763B2 (en) | Entity-relation database | |
Nørvåg | Supporting temporal text-containment queries in temporal document databases | |
CN115658634A (en) | Method for quickly positioning problems according to log information | |
EP1116137B1 (en) | Database, and methods of data storage and retrieval | |
US6792428B2 (en) | Method of storing and flattening a structured data document | |
CN115495462A (en) | Batch data updating method and device, electronic equipment and readable storage medium | |
CN114218277A (en) | Efficient query method and device for relational database | |
KR100921683B1 (en) | Method Of Data Storing In Memory Page With Key-Value Data Model | |
US9323753B2 (en) | Method and device for representing digital documents for search applications | |
CN1412694A (en) | Document library system storage and fetch recording method | |
US6978272B1 (en) | Method and apparatus for displaying instrumentation parameters in a database system | |
CN115328878B (en) | Log data storage system, method, device and medium | |
JP3980326B2 (en) | Data management method and computer-readable recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |