CN107180060A - The output intent and daily record output device of log information - Google Patents

The output intent and daily record output device of log information Download PDF

Info

Publication number
CN107180060A
CN107180060A CN201610141170.0A CN201610141170A CN107180060A CN 107180060 A CN107180060 A CN 107180060A CN 201610141170 A CN201610141170 A CN 201610141170A CN 107180060 A CN107180060 A CN 107180060A
Authority
CN
China
Prior art keywords
output
log information
process cycle
identifier
cycle
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
Application number
CN201610141170.0A
Other languages
Chinese (zh)
Inventor
张岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610141170.0A priority Critical patent/CN107180060A/en
Publication of CN107180060A publication Critical patent/CN107180060A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Abstract

The log-output method provided in the present invention, including:The unique identifier of the process cycle is obtained when a predefined process cycle starts;In this place in the reason cycle, output includes the log information of the process cycle identifier.Pass through customized process cycle, for each process cycle, one unique identifier is set, pass through unique identifier managing log information, so as to ensure that the log information in same process cycle has identical feature (i.e., identifier is identical), the log information in same process cycle is found and analyzed together by fast and easy.In multithreading and multi-course concurrency, the log information of each thread or process can be stripped out, and concurrent interference be eliminated, beneficial to quick positioning question.

Description

The output intent and daily record output device of log information
Technical field
The present invention relates to field of computer technology, and in particular to the output intent and daily record output device of a kind of log information.
Background technology
Log information is generally used for the various problems of logging software emerged in operation, research staff and operation maintenance personnel to software when being researched and developed and being safeguarded, substantial amounts of log code can be write in code, and is discovered problems and solve them by the log information exported in running software.With the development of computer technology, the size of code that business software is included substantially increases, and requires that operation system can keep prolonged stable operation simultaneously, especially some real-time service systems, once the regular traffic of company will be had a strong impact on by breaking down.Therefore, the requirement to research staff and operation maintenance personnel is very high.Some existing log recording modes are unfavorable for the management of daily record, and the help to research staff and operation maintenance personnel is limited.
For example, in the case of multithreading, one operation flow may be performed in multiple threads or process, if the log information recorded in each thread can not be integrated together, the data variation in operation maintenance personnel or the same operation flow of research staff's None- identified may then be made, result in a finding that and position abnormal data and abnormal problem is relatively difficult.
Again for example, in the case where being distributed deployment, an operation flow may relate to client modules, server module, database module etc., and the information that the log information recorded in above-mentioned module is provided is probably jump, it is discontinuous, result in a finding that problem and orientation problem are relatively difficult.
It is that research staff and operation maintenance personnel provide work facility therefore, it is necessary to provide a kind of more preferable log management mode.
The content of the invention
In view of this, the present invention provides the output intent of log information, to solve the above problems.
According to the first aspect of the invention there is provided a kind of output intent of log information, including:The unique identifier of the process cycle is obtained when a process cycle starts;In the process cycle, the log information of identifier of the output comprising the process cycle, wherein, the process cycle is pre-defined as needed.
Preferably, the process cycle is the life cycle of the object of a class.
Preferably, between at the beginning of the unique identifier includes the process cycle.
Preferably, the unique identifier includes the numerical value by a fixed step size increasing or decreasing.
Preferably, the log information that the output includes the identifier of the process cycle is one or more of combinations of following several way of outputs:
The log information is output to local console;
The log information is output to internal memory;
The log information is output to file;
The log information is output to database;
The log information is output to network.
Preferably, in addition to:At the beginning and end of the process cycle, the prompt message of identifier of the output comprising the process cycle.
Preferably, in addition to:In the process cycle, multiple processing fragments are set, at the beginning and end of the processing fragment, the prompt message of identifier of the output comprising the process cycle.
Preferably, the log information is write using unified form.
According to the second aspect of the invention there is provided a kind of daily record output device, including:Identifier element, the unique identifier for obtaining the process cycle when a predefined process cycle starts;Daily record output unit, in the process cycle, output to include the log information of the process cycle identifier.
Preferably, between at the beginning of the unique identifier includes the process cycle.
Preferably, the unique identifier includes the numerical value by a fixed step size increasing or decreasing.
Preferably, the daily record output unit includes following one or more of way of output:
The log information is output to console;
The log information is output to internal memory;
The log information is output to file;
The log information is output to database;
The log information is output to network.
The log-output method provided in the present invention, including:The unique identifier of the process cycle is obtained when a predefined process cycle starts;In this place in the reason cycle, output includes the log information of the process cycle identifier.Pass through customized process cycle, for each process cycle, one unique identifier is set, pass through unique identifier managing log information, so as to ensure that the log information in same process cycle has identical feature (i.e., identifier is identical), the log information in same process cycle is found and analyzed together by fast and easy.In multithreading and multi-course concurrency, the log information of each thread or process can be stripped out, and concurrent interference be eliminated, beneficial to quick positioning question.
Brief description of the drawings
Description by referring to the following drawings to the embodiment of the present invention, above-mentioned and other objects, features and advantages of the invention will be apparent from, in the accompanying drawings:
Fig. 1 is the flow chart of the output intent of log information according to embodiments of the present invention;
Fig. 2 is the structure chart of daily record output device according to embodiments of the present invention;
Fig. 3 is the schematic diagram of the code for example according to embodiments of the present invention.
Embodiment
Below based on embodiment, present invention is described, but the present invention is not restricted to these embodiments.It is detailed to describe some specific detail sections below in the detailed description of the present invention.The description of part can also understand the present invention completely without these details for a person skilled in the art.In order to avoid obscuring the essence of the present invention, known method, process, flow are not described in detail.What other accompanying drawing was not necessarily drawn to scale.
Flow chart, block diagram in accompanying drawing illustrate possible System Framework, function and the operation of the system, method, device of the embodiment of the present invention, square frame on flow chart and block diagram can represent a module, program segment or only one section of code, and the module, program segment and code are all the executable instructions for realizing regulation logic function.It should also be noted that the executable instruction for realizing regulation logic function can be reconfigured, so as to generate new module and program segment.Therefore the square frame of accompanying drawing and square frame order are used only to the process and step of preferably diagram embodiment, without should be in this, as the limitation to invention itself.
The core concept of the present invention is according to process cycle managing log information, identical unique identifier is included in log information in same process cycle, log information in same process cycle is easy for taking together, research staff or operation maintenance personnel find the situation of change of data from the log information collected, and judge whether this change is normal, so as to note abnormalities data, and orientation problem accordingly.
Fig. 1 is the flow chart of the output intent of log information according to embodiments of the present invention.The output intent of log information shown in Fig. 1 includes step 101-102.
In a step 101, the unique identifier of process cycle is obtained when a predefined process cycle starts
Here, the process cycle is performed by code combination of the research staff according to one group of completion specific function of business or code debugging requirement definition.It should be noted that process cycle mentioned here is a wide in range concept, research staff can any definition process cycle according to actual needs.For example, it is process cycle to define warehousing cycle, execution of order data input in the reason cycle in this place, order data sends work, and order data sends work, the flow such as order data picking.Relatively simple process cycle can also be defined, for example, define the object of a class (for example, order processing class RfTaskReqDto) life cycle be process cycle, then from the initialization of the object, the execution of object method, the extinction of object is included in the process cycle, the change of the order of the object handles is tracked by the log information of output, so as to pinpoint the problems.
When each process cycle starts to perform, the unique identifier of a process cycle is all obtained.The mode of acquisition is not limited, for example, each process cycle creates a unique identifier when starting, or can be passed to current process cycle by external program generation unique identifier.Here the form of identifier is not limited equally.In a preferred embodiment, as unique identifier between can obtaining at the beginning of current processing cycle, but need to consider to ensure that the identifier is unique between different thread/processes in the case of multithreading and multi-course concurrency, so between generally using at the beginning of Millisecond, being so substantially avoided that identifier is repeated.Or, using a random number for carrying out increasing or decreasing according to a fixed step size, avoid repeating to obtain by write-protect.Or, using the combination of above two mode.In a word, the uniqueness of the identifier of process cycle must assure that, only in this way, log information can be made to be exported according to pre-provisioning request, so as to facilitate research staff and operation maintenance personnel to extract log information.
In a step 102, in process cycle, output includes the log information of process cycle identifier.
In this step, the identifier of process cycle is all included for all log informations exported in current processing cycle.In a preferred embodiment, in multiple processing fragments of a process cycle, the prompt message of the identifier comprising the process cycle is exported in each processing fragment beginning and end position, schematic code is as shown in Figure 3.
In figure 3, method getTask is that the name in a process cycle is the processing fragment of " getting task business ", and when reason fragment starts in this place, reqDto.getLogTime () obtains logtime (i.e., unique identifier), pass through code
Logger.info (" getting task business "+" logTime "
+reqDto.getLogTime()+“data”+reqDto.orderId()
+“segment:begin”);
The beginning prompt message for exporting the fragment is as follows:
Get task business logtime 34567883data 100081segment:begin.
Similarly, output prompt message is as follows after terminating after the fragment:
Get task business logtime 34567883segment:end.
So, all log informations of processing fragment output are included in " segment:Begin " and " segment:Between end " prompt message, it is easy to search all log informations in this processing fragment.If occurring Database lock table in the middle of the fragment or program exception occur, " segment:End " can not just be exported, it is possible thereby to which abnormal and abnormal approximate location occurs in decision procedure.
It will be appreciated by those skilled in the art that, above-mentioned fragment is by research staff's self-defining as needed, research staff can also carry out the definition of the way of output different from aforesaid way, for example, exporting the prompt message of process cycle beginning and end in each process cycle beginning and end.As long as being conducive to distinguishing and sorting out log information, similar prompt message can be defined arbitrarily.Here do not limit.
In a preferred embodiment, log information needs to use unified form to write, for example, journal format is uniformly:Business description+logTime+ business datums (processing data for including suction parameter, outlet parameter and centre)+procedure links sign (such as one flow begin and end or numeral).
In the written in code of object-oriented, in a preferred embodiment, the process cycle is the life cycle of a class object.Unique identifier can be as such member, in the object formation of class to unique identifier assignment, and when object is deleted, the identifier is withered away, or the identifier regard the life cycle of the object of derived class as a process cycle as the member of parent.Similar code is as follows:
What //logTime should be assigned in the construction of data,
RfTaskReqDto reqDto=new RfTaskReqDto ();
ReqDto.setLogTime (unique mark);
In another preferred embodiment, it is described to export the one or more of combinations for including the log information of process cycle identifier for following several way of outputs in step 102.
First, log information is output to local console.
Second, log information is output to internal memory.
3rd, log information is output to file.
4th, log information is output to database.
5th, log information is output to network.
Although the way of output to log information gives some explanations in the present invention, it will be appreciated by those skilled in the art that arriving, according to the difference of practical application, the way of output can be changed, and the present invention also and is not limited to this.
The log-output method provided in the present invention, including:The unique identifier of the process cycle is obtained when a predefined process cycle starts;In this place in the reason cycle, output includes the log information of the process cycle identifier.Pass through customized process cycle, for each process cycle, one unique identifier is set, pass through unique identifier managing log information, so as to ensure that the log information in same process cycle has identical feature (i.e., identifier is identical), the log information in same process cycle is found and analyzed together by fast and easy.In multithreading and multi-course concurrency, the log information of each thread or process can be stripped out, and concurrent interference be eliminated, beneficial to quick positioning question.
Fig. 2 is the structure chart of daily record output device according to embodiments of the present invention.Described daily record output device 20 on figure, including identifier element 201 and daily record output unit 202.
Identifier element 201 obtains the unique identifier of process cycle when a predefined process cycle starts.Here, process cycle is research staff's customized processing procedure for including some codes according to actual needs.To the period indication, it is easy to search the daily record of output in each process cycle.Equally, the generation method and form of identifier are all self-defined by research staff here.Such as, Millisecond time or random number are created as identifier, but must assure that the unique of identifier, to be considered under conditions of multi-process, multi-thread concurrent, it is unique that whether identifier, which ensure that,.
Daily record output unit 202 is in process cycle, and output includes the log information of process cycle identifier.The log information of output can make a distinction according to the classification of log information in the process cycle, such as warning information, prompt message, error message etc., the identifier in cycle all exported when exporting these information simultaneously where.The log information of output can be exported according to following one or more of modes, such as:
Log information is output to local console;
Log information is output to internal memory;
Log information is output to file;
Log information is output to database;
Log information is output to network.
In the written in code of object-oriented, above-mentioned process cycle is the life cycle of a class object.Unique identifier can be as such member, in the object formation of class to unique identifier assignment, and when object is deleted, the identifier is withered away, or the identifier regard the life cycle of the object of derived class as a process cycle as the member of parent.When procedure-oriented is encoded, above-mentioned process cycle is the life cycle of function, including function starts, and operation is until wither away.
It will be appreciated by those skilled in the art that arriving, one process or thread can include multiple predefined process cycles, one predefined process cycle can be realized in multiple processes or thread, similarly, process cycle can also include the code of client and service end simultaneously, mainly useful for research staff searches and classification log information, and these are not limited.
The daily record output device that the present invention is provided, including:Identifier element, the unique identifier for obtaining process cycle when a predefined process cycle starts;Daily record output unit, in process cycle, output to include the log information of process cycle identifier.The device that the present invention is provided passes through unique identifier managing log information, so as to ensure that the log information in same process cycle has identical feature (i.e., identifier is identical), help quick find the log information in same process cycle of research staff to be analyzed together.
The modules or unit of system can be realized by hardware, firmware or software.The coded program of software various programming language formation such as including using JAVA, C/C++/C#, SQL.Although the step of providing the embodiment of the present invention in method and method legend and the order of step, the step realizes that the executable instruction of defined logic function can be reconfigured, so as to generate new step.The step order that the order of the step also should not be restricted solely in methods described and method legend, can at any time be adjusted according to the need for function.For example some steps therein are performed parallel or according to reverse order.
System and a method according to the invention can be deployed on single or multiple servers.For example, can dispose different modules respectively on a different server, private server is formed.Or, can on multiple servers distributed deployment identical functional unit, module or system, to mitigate load pressure.The server includes but is not limited in same LAN and passes through Internet multiple PCs, PC server, rolling reamer machine, supercomputers connected etc..
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, to those skilled in the art, the present invention can have various changes and change.All any modification, equivalent substitution and improvements made within spirit and principles of the present invention etc., should be included in the scope of the protection.

Claims (12)

1. a kind of output intent of log information, including:
The unique identifier of the process cycle is obtained when a process cycle starts;
In the process cycle, the log information of identifier of the output comprising the process cycle,
Wherein, the process cycle is pre-defined as needed.
2. output intent according to claim 1, wherein, the process cycle is a class Object life cycle.
3. output intent according to claim 1, wherein, the unique identifier includes institute Between stating at the beginning of process cycle.
4. output intent according to claim 1, wherein, the unique identifier is included and pressed The numerical value of one fixed step size increasing or decreasing.
5. the output intent according to described in claim 1, wherein, the output includes the processing The log information of the identifier in cycle is one or more of combinations of following several way of outputs:
The log information is output to local console;
The log information is output to internal memory;
The log information is output to file;
The log information is output to database;
The log information is output to network.
6. the way of output according to claim 1, in addition to:Start in the process cycle With at the end of, the prompt message of identifier of the output comprising the process cycle.
7. the way of output according to claim 1, in addition to:Set in the process cycle Multiple processing fragments, at the beginning and end of the processing fragment, output includes the process cycle Identifier prompt message.
8. output intent according to claim 1, wherein, the log information uses unified Form is write.
9. a kind of daily record output device, including:
Identifier element, for obtaining the processing week when a predefined process cycle starts The unique identifier of phase;
Daily record output unit, in the process cycle, output to include the process cycle mark Know the log information of symbol.
10. daily record output device according to claim 9, wherein, the process cycle is The life cycle of the object of one class.
11. daily record output device according to claim 9, wherein, the unique identifier Include the numerical value by a fixed step size increasing or decreasing.
12. the daily record output device according to described in claim 9, wherein, the daily record output is single Member includes following one or more of way of output:
The log information is output to console;
The log information is output to internal memory;
The log information is output to file;
The log information is output to database;
The log information is output to network.
CN201610141170.0A 2016-03-11 2016-03-11 The output intent and daily record output device of log information Pending CN107180060A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610141170.0A CN107180060A (en) 2016-03-11 2016-03-11 The output intent and daily record output device of log information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610141170.0A CN107180060A (en) 2016-03-11 2016-03-11 The output intent and daily record output device of log information

Publications (1)

Publication Number Publication Date
CN107180060A true CN107180060A (en) 2017-09-19

Family

ID=59830477

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610141170.0A Pending CN107180060A (en) 2016-03-11 2016-03-11 The output intent and daily record output device of log information

Country Status (1)

Country Link
CN (1) CN107180060A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240917A (en) * 2018-08-13 2019-01-18 山东中创软件工程股份有限公司 A kind of blog management method and relevant apparatus
CN110309158A (en) * 2018-04-13 2019-10-08 腾讯科技(深圳)有限公司 Rolling abnormality judgment method, device and the readable medium of journal file

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100825257B1 (en) * 2007-09-05 2008-04-25 주식회사 나우콤 Detail processing method of abnormal traffic data
CN102902813A (en) * 2012-10-22 2013-01-30 北京奇虎科技有限公司 Log collection system
CN105260292A (en) * 2015-10-09 2016-01-20 中国人民财产保险股份有限公司 Log recording method, apparatus and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100825257B1 (en) * 2007-09-05 2008-04-25 주식회사 나우콤 Detail processing method of abnormal traffic data
CN102902813A (en) * 2012-10-22 2013-01-30 北京奇虎科技有限公司 Log collection system
CN105260292A (en) * 2015-10-09 2016-01-20 中国人民财产保险股份有限公司 Log recording method, apparatus and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309158A (en) * 2018-04-13 2019-10-08 腾讯科技(深圳)有限公司 Rolling abnormality judgment method, device and the readable medium of journal file
CN110309158B (en) * 2018-04-13 2023-08-01 腾讯科技(深圳)有限公司 Method and device for judging rolling abnormality of log file and readable medium
CN109240917A (en) * 2018-08-13 2019-01-18 山东中创软件工程股份有限公司 A kind of blog management method and relevant apparatus

Similar Documents

Publication Publication Date Title
CN107943668B (en) Computer server cluster log monitoring method and monitor supervision platform
CN107147639B (en) A kind of actual time safety method for early warning based on Complex event processing
WO2022088804A1 (en) Message pushing method and apparatus, and electronic device, and storage medium
US20180129579A1 (en) Systems and Methods with a Realtime Log Analysis Framework
CN110351150B (en) Fault source determination method and device, electronic equipment and readable storage medium
Yang et al. A system architecture for manufacturing process analysis based on big data and process mining techniques
CN104216948B (en) A kind of difference control method of data model
CN105068920B (en) A kind of method based on shell test rack assets information stability
CN112416645B (en) Fault root cause deducing and positioning method and device based on artificial intelligence
CN110752969B (en) Performance detection method, device, equipment and medium
CN105610819B (en) The method and apparatus of the query service of server info are provided
CN104036365A (en) Method for constructing enterprise-level data service platform
CN107491371B (en) Deployment monitoring method and device
EP3798848B1 (en) Analyzing large-scale data processing jobs
KR102067032B1 (en) Method and system for data processing based on hybrid big data system
CN102611565A (en) Regular-expression-based alarm correlation analysis method for monitoring system
CN106341257A (en) Method and tool for customizing log analysis rules and automatically analyzing logs
US20110040805A1 (en) Techniques for parallel business intelligence evaluation and management
CN106210124A (en) A kind of unified cloud data center monitoring system
CN103973484B (en) A kind of operation management system based on network topology structure
CN113067717A (en) Network request log chain tracking method, full link call monitoring system and medium
CN107180060A (en) The output intent and daily record output device of log information
CN112506969A (en) BMC address query method, system, equipment and readable storage medium
CN105632248A (en) Safety monitoring system and data processing method therefor
CN108021411A (en) A kind of discovery system of calling service relation and discovery method

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170919