CN107678908A - Log recording method, device, computer equipment and storage medium - Google Patents

Log recording method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN107678908A
CN107678908A CN201710488996.9A CN201710488996A CN107678908A CN 107678908 A CN107678908 A CN 107678908A CN 201710488996 A CN201710488996 A CN 201710488996A CN 107678908 A CN107678908 A CN 107678908A
Authority
CN
China
Prior art keywords
functional module
log recording
logging level
history
error message
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.)
Granted
Application number
CN201710488996.9A
Other languages
Chinese (zh)
Other versions
CN107678908B (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201710488996.9A priority Critical patent/CN107678908B/en
Priority to PCT/CN2017/108061 priority patent/WO2018233170A1/en
Publication of CN107678908A publication Critical patent/CN107678908A/en
Application granted granted Critical
Publication of CN107678908B publication Critical patent/CN107678908B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3072Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
    • G06F11/3082Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting the data filtering being achieved by aggregating or compressing the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Abstract

The present invention proposes a kind of log recording method, and methods described includes:Obtain the Function Identification corresponding to the functional module run in server;The history log record according to corresponding to the Function Identification extracts each functional module;The history error message according to corresponding to history log record corresponding to each functional module counts each functional module;Logging level corresponding with each functional module is determined according to the history error message, logging level reflects the fineness of log recording;Corresponding log recording is carried out according to logging level corresponding to each functional module.By being carried out that resource consumption can be greatly reduced using graduate log recording accordingly according to the superiority-inferiority of functional module.In addition, it is also proposed that a kind of log recording apparatus, computer equipment and storage medium.

Description

Log recording method, device, computer equipment and storage medium
Technical field
The present invention relates to computer disposal field, more particularly to a kind of log recording method, device, computer equipment and Storage medium.
Background technology
Log recording either suffers from also or in test phase critically important in program development stage or operation phase Effect, one of them it is most important effect be when occur it is abnormal when can be by the daily record of record come orientation problem.Traditional Log recording is in which kind of state all uses same log recording granularity, and traditional day regardless of the functional module in server The record granularity that will record uses is often relatively finer, results in the need for consuming the record that substantial amounts of resource carries out a large amount of daily records.
The content of the invention
Based on this, it is necessary in view of the above-mentioned problems, proposing a kind of log recording method that can save resource consumption, dress Put, computer equipment and storage medium.
A kind of log recording method, methods described include:Obtain the function corresponding to the functional module run in server Mark;The history log record according to corresponding to the Function Identification extracts each functional module;According to each functional module Corresponding history log record counts history error message corresponding to each functional module;Determined according to the history error message Logging level corresponding with each functional module, logging level reflect the fineness of log recording;According to each functional module Corresponding logging level carries out corresponding log recording.
In one of the embodiments, methods described also includes:Obtain operation duration corresponding to each functional module;It is described Logging level corresponding with each functional module is determined according to the history error message, logging level reflects log recording Fineness includes:Each functional module pair is determined according to history error message and operation duration corresponding to each functional module The logging level answered, logging level reflect the fineness of log recording, and higher grade, and log recording is finer.
In one of the embodiments, the Function Identification corresponding to the functional module included in server is obtained it It is preceding also to include:The running environment type that detection service device is presently in;Determined and the operation according to the running environment type Logging level division rule corresponding to environmental form.
In one of the embodiments, the history log record statistics according to corresponding to each functional module is each History error message includes corresponding to functional module:It is each according to history log record statistics corresponding to each functional module Kind type of error and corresponding error message quantity;The error message according to corresponding to each functional module determines each Logging level corresponding to functional module, the fineness that logging level reflects log recording include:According to each functional module pair The type of error message answered and corresponding error message quantity calculate logging level corresponding to each functional module, and logging level is anti- The fineness of log recording is reflected, higher grade, and log recording is finer.
In one of the embodiments, logging level corresponding to each functional module of the basis carries out corresponding daily record note Record includes:Determine that the corresponding daily record of each functional module is remembered according to the corresponding relation of default logging level and log recording rule Record rule;Corresponding log recording is carried out according to log recording rule corresponding to each functional module.
A kind of log recording apparatus, described device include:Identifier acquisition module, for obtaining the function of being run in server Function Identification corresponding to module;Extraction module, for the history according to corresponding to Function Identification extraction each functional module Log recording;Statistical module, each functional module is counted for the history log record according to corresponding to each functional module Corresponding history error message;Determining module, it is corresponding with each functional module for being determined according to the history error message Logging level, logging level reflect the fineness of log recording;Logging modle, for the day according to corresponding to each functional module Will grade carries out corresponding log recording.
In one of the embodiments, described device also includes:Duration acquisition module, for obtaining each functional module pair The operation duration answered;When the determining module is additionally operable to the history error message according to corresponding to each functional module and run Long to determine logging level corresponding to each functional module, logging level reflects the fineness of log recording, and higher grade, daily record Record is finer.
In one of the embodiments, described device also includes:Detection module, the fortune being presently in for detection service device Row environmental form;Regular determining module, it is corresponding with the running environment type for being determined according to the running environment type Logging level division rule.
In one of the embodiments, the statistical module is additionally operable to the history day according to corresponding to each functional module Will record counts each type of error and corresponding error message quantity;The determining module is additionally operable to according to each function mould Type of error message corresponding to block and corresponding error message quantity calculate logging level, daily record etc. corresponding to each functional module Level reflects the fineness of log recording, and higher grade, and log recording is finer.
In one of the embodiments, the logging modle is additionally operable to according to default logging level and log recording rule Corresponding relation determine corresponding to each functional module log recording rule, advised according to log recording corresponding to each functional module Then carry out corresponding log recording.
A kind of computer equipment, the computer equipment include memory, processor and are stored on the memory simultaneously The computer program that can be run on the processor, following steps are realized during computer program described in the computing device: Obtain the Function Identification corresponding to the functional module run in server;Each functional module pair is extracted according to the Function Identification The history log record answered;According to corresponding to history log record corresponding to each functional module counts each functional module History error message;It is anti-according to history error message determination logging level corresponding with each functional module, logging level The fineness of log recording is reflected;Corresponding log recording is carried out according to logging level corresponding to each functional module.
A kind of computer-readable recording medium, is stored thereon with computer instruction, and the instruction is realized when being executed by processor Following steps:Obtain the Function Identification corresponding to the functional module run in server;It is each according to Function Identification extraction History log corresponding to functional module records;Each function is counted according to history log record corresponding to each functional module History error message corresponding to module;Logging level corresponding with each functional module is determined according to the history error message, Logging level reflects the fineness of log recording;Corresponding daily record note is carried out according to logging level corresponding to each functional module Record.
Above-mentioned log recording method, device, computer equipment and storage medium, the history log according to corresponding to functional module The history error message occurred in record judges the superiority-inferiority of the corresponding function module, if history log corresponding to functional module History error message is less in record, illustrates that the functional module is more excellent, can use the log recording of inferior grade, subtract significantly The recorded amounts of daily record is lacked, if history error message is relatively more in functional module, has illustrated that the functional module is easier to occur Problem, then need high-grade log recording, high-grade log recording refers to record more detailed log recording, is easy to The follow-up positioning for carrying out problem.In fact, most of functional module in server goes wrong all in good stable state Probability very little, it is only necessary to a small amount of log information is recorded, so according to the superiority-inferiority of functional module using graduate Log recording method can greatly reduce resource consumption.
Brief description of the drawings
Fig. 1 is the internal structure schematic diagram of one embodiment Computer equipment;
Fig. 2 is the flow chart of log recording method in one embodiment;
Fig. 3 is the flow chart of log recording method in another embodiment;
Fig. 4 is the flow chart of log recording method in another embodiment;
Fig. 5 is that logging level carries out the side of corresponding log recording according to corresponding to each functional module in one embodiment Method flow chart;
Fig. 6 is the structured flowchart of log recording apparatus in one embodiment;
Fig. 7 is the structured flowchart of log recording apparatus in another embodiment;
Fig. 8 is the structured flowchart of log recording apparatus in another embodiment.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Fig. 1 is the internal structure schematic diagram of one embodiment Computer equipment, and the computer equipment can be server. Reference picture 1, the computer equipment include by system bus connection processor, non-volatile memory medium, built-in storage and Network interface.Wherein, the non-volatile memory medium of the computer equipment can storage program area and computer-readable instruction, should When computer-readable instruction is performed, a kind of log recording method of computing device may be such that.The processor of the computer equipment For providing calculating and control ability, the operation of whole computer equipment is supported.Can store computer in the built-in storage can Reading instruction, when the computer-readable instruction is executed by processor, it may be such that a kind of log recording method of computing device.Computer The network interface of equipment is used to carry out network service.It will be understood by those skilled in the art that the structure shown in Fig. 1, is only The block diagram of the part-structure related to application scheme, the computer equipment being applied thereon to application scheme is not formed Restriction, specific computer equipment can include than more or less parts shown in figure, or some parts of combination, or Person has different part arrangements.
As shown in Fig. 2 in one embodiment it is proposed that a kind of log recording method, this method include:
Step 202, the Function Identification corresponding to the functional module run in server is obtained.
In the present embodiment, functional module refers to the program for realizing some functional task.Functional module is operationally It is possible to that exception can occur, in order to be investigated, it is necessary in advance when the functional module is run to abnormal Producing reason occurs Log recording is carried out, log recording is used for the running situation of writing function module, such as, record the mistake occurred during operation, police Accuse etc., it is easy to subsequently according to where searching problem log recording.Multiple functional modules, day can be often run in one server Will record is corresponding with functional module, and each functional module can correspond to a corresponding log recording program.Function Identification For unique mark One function module.The Function Identification corresponding to functional module run by obtaining in server, is easy to Subsequently corresponding history log is searched according to Function Identification to record.
Step 204, the history log record according to corresponding to Function Identification obtains each functional module.
In the present embodiment, history log record refers to the record of the running situation progress to functional module before, daily record The packet of record includes the error message of existing mistake, and error message can be divided into fatal error, gross error and common error again, Certainly some warning messages and general information and various configuration informations etc. can also be included.Each functional module can correspond to one Log recording, for the ease of log query, the Function Identification of functional module is associated with corresponding log recording deposited in advance Storage, history log records so according to corresponding to Function Identification can gets the corresponding function module.
Step 206, history log record counts history corresponding to each functional module according to corresponding to each functional module Error message.
In the present embodiment, history log describes the running situation before functional module, including occurs before Error message.The history mistake letter occurred by obtaining historical record corresponding to functional module to count before the functional module Breath.Statistical history error message is to know the superiority-inferiority of functional module operation, and superiority-inferiority goes out for evaluation function module The probability of existing problem.In one embodiment, because time history log remote is recorded for assessing current functional module The effect of superiority-inferiority is little, it is possible to the history log record of (such as nearly three months) is only obtained in nearest certain time, Only need to obtain the history log record in preset time period, then count in the preset time period to go out in history log record The number of existing error message.In order to more accurately be assessed according to history error message the superiority-inferiority of functional module, at one In embodiment, mistake is classified according to the order of severity of mistake first, then counts corresponding per a kind of type of error and occurs Errors number.For example type of error is divided into fatal error, gross error and the class of common error three according to the order of severity, so Statistics corresponds to the number occurred per a kind of mistake respectively afterwards.
Step 208, logging level corresponding with each functional module, logging level reflection are determined according to history error message The fineness of log recording.
In the present embodiment, because the superiority-inferiority of difference in functionality module is different, in order to save resource consumption, Ke Yigen Corresponding logging level is determined according to the superiority-inferiority of functional module.Logging level reflection be log recording fineness, grade It is higher, corresponding log recording it is finer, the resource of corresponding consumption is more;Lower grade, the granularity of corresponding log recording Thicker, the resource of corresponding consumption is fewer.If functional module is more excellent, illustrate that the functional module seldom goes wrong, then Only need to record less daily record, you can so that corresponding logging level is arranged into relatively low grade;If functional module compares Difference, illustrate that the probability that functional module operation goes wrong is bigger, it is corresponding just to need to record more detailed daily record, this day Will grade needs to use higher grade, is easy to the follow-up positioning for carrying out problem.In fact, the big portion of functional module in server Divide all in stable state, the probability very little of failure, it is only necessary to record a small amount of log information.So by according to function mould Block targetedly carries out log recording, can greatly reduce resource consumption.
Specifically, by obtaining the superiority-inferiority of history error message arbitration functions module corresponding to functional module, if gone through The error message occurred in history log recording is fewer, illustrates that the performance comparision of the functional module is excellent, if error message ratio It is more, then just to illustrate that the performance of the functional module is relatively poor, easily go wrong.In one embodiment, can be direct Corresponding relation between history error message and logging level is set, and history error message is more, and corresponding logging level is higher. In another embodiment, can also be first according to history error message according to the excellent of default computation rule computing function module Good degree, corresponding logging level is then determined according to the seed superiority being calculated.
Step 210, logging level carries out corresponding log recording according to corresponding to each functional module.
In the present embodiment, grade classification is carried out to log recording in advance, log recording is detailed corresponding to different stage Degree is different, and logging level is higher, it is necessary to which the daily record of record is more detailed, and logging level is lower, and the daily record of record is more coarse.Daily record The rank of record is the log recording of from top to bottom compatible, high-grade log recording compatibility inferior grade.Such as daily record rank point It is to close all log informations for 10 ranks, corresponding to first level;It is only to record fatal error corresponding to second level Information;It is record gross error and fatal message corresponding to third level;Be corresponding to fourth level record common error, Gross error and fatal message;It is record warning message, common error, gross error and fatal mistake corresponding to 5th grade False information;The like, until the 10th grade records all information.That is, high-grade log recording is compatible all low The log recording of grade, higher grade, record it is finer.Specifically, logging level is drawn previously according to the fineness of record Point, and log recording rule corresponding to each grade is set, such as, the log recording rule of highest ranking is to record all letters Breath, the log recording rule of the lowest class is not record any information.After logging level corresponding to each functional module is determined, Can log recording rule according to corresponding to logging level carries out corresponding log recording.Pass through the quality according to functional module Property determine corresponding logging level, be advantageous to save resource consumption, while can also ensure the subsequently positioning to problem.
Above-mentioned log recording method, in the history log record according to corresponding to functional module the history error message that occurs come Judge the superiority-inferiority of the corresponding function module, if history error message is less in history log record corresponding to functional module, say The bright functional module is more excellent, can use the log recording of inferior grade, the recorded amounts of daily record is greatly reduced, if function History error message is relatively more in module, illustrates that the functional module is easier to go wrong, then need high-grade daily record Record, high-grade log recording refer to the more detailed log recording of record, are easy to the follow-up positioning for carrying out problem.It is true On, most of functional module in server is all in good stable state, the probability very little to go wrong, it is only necessary to which record is few The log information of amount, so resource can be greatly reduced using the method for graduation record according to the superiority-inferiority of functional module Consumption.
As shown in figure 3, in one embodiment it is proposed that another log recording method, this method include:
Step 302, the Function Identification corresponding to the functional module run in server is obtained.
Step 304, the history log record according to corresponding to Function Identification obtains each functional module.
Step 306, history log record counts history corresponding to each functional module according to corresponding to each functional module Error message.
Step 307, operation duration corresponding to each functional module is obtained.
Step 308, history error message and operation duration determine each functional module according to corresponding to each functional module Corresponding logging level, logging level reflect the fineness of log recording, and higher grade, and log recording is finer.
Step 310, logging level carries out corresponding log recording according to corresponding to each functional module.
In the present embodiment, in order to preferably determine logging level corresponding to functional module, except wanting statistical history Error message is determined outside the superiority-inferiority of functional module, it is also necessary to obtains the operation duration of functional module, operation duration here Refer to total operation duration, operation duration is longer, and its corresponding stability is higher.History mistake is believed according to corresponding to functional module Breath and operation duration can preferably determine the probability size that functional module goes wrong, if functional module go wrong it is general Rate is smaller, then can is arranged to relatively low logging level, if the probability that functional module goes wrong is larger, then can be with It is arranged to higher logging level.(i.e. operation duration is shorter) can remember daily record, it is necessary to refine daily record when general utility functions are just reached the standard grade The grade of record is set to highest, function tend towards stability after (after operation longer period of time), daily record can be arranged to relatively low etc. Level, for example only record the fatal message of appearance.
In the present embodiment, by obtaining history log error on the face of the record information and operation duration corresponding to functional module Carry out the seed superiority and stability of evaluation function module.If the seed superiority and stability of functional module are all very high, illustrate the function The probability that module goes wrong is very low, it is only necessary to a small amount of daily record is recorded, if the seed superiority of functional module and stability are all It is poor, then just to need to record more detailed daily record.Specifically, it can pre-set and be weighed corresponding to seed superiority and stability Value, and respective standards of grading, the good and bad fractional value of reflection function module corresponding to functional module is then calculated, Corresponding logging level is determined according to fractional value, and then corresponding log recording is carried out according to the logging level of determination.By right Functional module carries out double standards and carrys out the probability that Function of Evaluation module goes wrong, so that it is determined that corresponding logging level, can Resource consumption is preferably saved, while nor affects on the subsequently positioning to problem.
As shown in figure 4, in one embodiment, the Function Identification corresponding to functional module included in server is obtained The step of before also include:
Step 200, the running environment type that detection service device is presently in.
In the present embodiment, the running environment residing for server is different, and its corresponding logging level division rule can be Difference, so needing, according to different running environment, to set logging level division rule corresponding with each environment respectively.Clothes The running environment of business device can be divided into development environment, test environment and production environment.Varying environment type divides to logging level Standard it is different, so before the step of obtaining the Function Identification corresponding to the functional module that includes of server, first The running environment type that detection service device is presently in.It is easy to determine corresponding logging level division rule according to environmental form Then.Detection service device be presently in running environment method have it is a variety of, such as, can pre-set different servers be responsible for not Same task, it is assumed that set A servers to be responsible for corresponding test, the responsible corresponding production of B servers, C servers are responsible for corresponding Exploitation.So the follow-up mark can according to the server extracted directly determines the environmental form residing for server.Than Such as, if the server identification extracted is the mark of A servers, then corresponding environmental form is test environment.Server Identify and be used for one server of unique mark.
Step 202, logging level division rule corresponding with running environment type is determined according to running environment type.
In the present embodiment, the division rule for the logging level that varying environment type determines is different, pre-sets environmental classes Corresponding relation between type and logging level division rule, after the running environment type of server is determined, it is possible to according to Corresponding relation between environmental form and logging level division rule determines corresponding logging level division rule.Such as if It is production environment, 10 grades can be divided into, if test environment, then can be divided into trace | debug | info | Warn | error | fatal | seven ranks of none, wherein, from trace to none, rank is more and more lower.None is expressed as not remembering Record, trace is complete record daily record.When the error message occurred in history log record is higher, illustrate needs refinement debugging, Can respective record be trace or debug.When in history log record the error message that occurs than it is relatively low when, rank can be set For fatal or none.
In the present embodiment, due to the difference of server running environment, to the division rule of daily record classification grade not Together, so needing to pre-set the corresponding relation between environmental form and logging level division rule, it is easy to targetedly to work( Energy module carries out corresponding log recording, so as to advantageously also can guarantee that the normal of functional module while resource is being saved Operation.
In one embodiment, it is corresponding to count each functional module for the history log record according to corresponding to each functional module History error message the step of include:Each type of error is counted according to history log record corresponding to each functional module With corresponding error message quantity;The daily record according to corresponding to error message corresponding to each functional module determines each functional module Grade, the step of logging level reflects the fineness of log recording, include:According to error message corresponding to each functional module Type and corresponding error message quantity calculate logging level corresponding to each functional module.
In the present embodiment, history error message includes type of error and corresponding error message quantity.Type of error root It can be divided into fatal error, gross error and common error according to the order of severity.Quantity corresponding to every kind of type of error is counted, according to work( Type of error and the seed superiority of corresponding error message quantity computing function module corresponding to energy module, it can pre-set total Point, then the weight of different type of errors is set, according to weight and the product of corresponding error message quantity, then use what is set Total score subtracts each type of error and is multiplied by the fractional value that corresponding weight is represented seed superiority accordingly.For example total score is set For Z, fatal error occurrence number is X1 times, and the number that gross error occurs is X2 times, and the number that common error occurs is X3 times, The weight for setting fatal error is A, and the weight of gross error is B, and the weight of common error is C, then corresponding seed superiority= Z- (A*X1+B*X2+C*X3), wherein weight A>B>C.Then corresponding logging level is determined according to the seed superiority being calculated, The corresponding relation between seed superiority and logging level is pre-set, seed superiority is higher, and corresponding logging level is lower.
As shown in figure 5, in one embodiment, corresponding daily record is carried out according to logging level corresponding to each functional module The step of record, includes:
Step 210A, each functional module pair is determined according to the corresponding relation of default logging level and log recording rule The log recording rule answered.
Step 210B, corresponding log recording is carried out according to log recording rule corresponding to each functional module.
In the present embodiment, log recording the division of grade has been subjected to previously according to the fineness of log recording, set Log recording rule, log recording rule define the particle of corresponding log recording corresponding to each grade after division Degree, such as, if logging level is to record all information for the log recording rule of highest ranking, the log recording of the lowest class Rule is not record any information.After logging level corresponding to each functional module is determined, it is possible to according to logging level pair The log recording rule answered carries out corresponding log recording.Corresponding daily record etc. is determined by the superiority-inferiority according to functional module Level, and then corresponding log recording is carried out, be advantageous to save resource consumption, while can also ensure the subsequently positioning to problem. In one embodiment, the recorded separately storage of the daily record of different type of errors is easy to subsequently according to mistake during progress log recording Type is quickly searched by mistake.
As shown in fig. 6, in one embodiment it is proposed that a kind of log recording apparatus, the device include:
Identifier acquisition module 602, for obtaining the Function Identification corresponding to the functional module run in server;
Extraction module 604, for the history log record according to corresponding to Function Identification extraction each functional module;
Statistical module 606, each function mould is counted for the history log record according to corresponding to each functional module History error message corresponding to block;
Determining module 608, for determining logging level corresponding with each functional module according to the history error message, Logging level reflects the fineness of log recording;
Logging modle 610, corresponding log recording is carried out for the logging level according to corresponding to each functional module.
As shown in fig. 7, in one embodiment, above-mentioned log recording apparatus also includes:
Duration acquisition module 607, for obtaining operation duration corresponding to each functional module;
The determining module 608 is additionally operable to history error message and operation duration according to corresponding to each functional module It is determined that logging level corresponding to each functional module, logging level reflect the fineness of log recording, higher grade, daily record note Record is finer.
As shown in figure 8, in one embodiment, above-mentioned log recording apparatus also includes:
Detection module 600, the running environment type being presently in for detection service device;
Regular determining module 601, it is corresponding with the running environment type for being determined according to the running environment type Logging level division rule.
In one embodiment, statistical module 606 is additionally operable to the history log note according to corresponding to each functional module Record counts each type of error and corresponding error message quantity;The determining module 608 is additionally operable to according to each function mould Type of error message corresponding to block and corresponding error message quantity calculate logging level, daily record etc. corresponding to each functional module Level reflects the fineness of log recording, and higher grade, and log recording is finer.
In one embodiment, logging modle 610 is additionally operable to pair according to default logging level and log recording rule It should be related to and determine log recording rule corresponding to each functional module, be entered according to log recording rule corresponding to each functional module The corresponding log recording of row.
In one embodiment it is proposed that a kind of computer equipment, the computer equipment include memory, processor and It is stored in the computer program that can be run on the memory and on the processor, computer described in the computing device Following steps are realized during program:Obtain the Function Identification corresponding to the functional module run in server;According to the function mark Know and extract history log record corresponding to each functional module;According to history log record system corresponding to each functional module Count history error message corresponding to each functional module;Determined according to the history error message corresponding with each functional module Logging level, logging level reflect the fineness of log recording;Phase is carried out according to logging level corresponding to each functional module The log recording answered.
In one embodiment, computer program described in the computing device is to be additionally operable to realize following steps:Obtain Operation duration corresponding to each functional module;Determined and each work(according to the history error message performed by the processor Can logging level corresponding to module, the step of logging level reflects the fineness of log recording includes:According to each work( History error message and operation duration corresponding to energy module determine logging level corresponding to each functional module, logging level reflection The fineness of log recording, higher grade, log recording is finer.
In one embodiment, before the Function Identification corresponding to the functional module included in obtaining server, The processor is additionally operable to perform following steps:The running environment type that detection service device is presently in;According to the operation ring Border type determines logging level division rule corresponding with the running environment type.
In one embodiment, the history log note according to corresponding to each functional module performed by the processor Include corresponding to each functional module of record statistics the step of history error message:According to history corresponding to each functional module Log recording counts each type of error and corresponding error message quantity;Performed by the processor according to described each Error message corresponding to functional module determines logging level corresponding to each functional module, and logging level reflects log recording The step of fineness, includes:Calculated according to type of error message corresponding to each functional module and corresponding error message quantity every Logging level corresponding to individual functional module, logging level reflect the fineness of log recording, and higher grade, and log recording is more smart Carefully.
In one embodiment, logging level corresponding to each functional module of basis performed by the processor carries out phase The step of log recording answered, includes:Each function is determined according to the corresponding relation of default logging level and log recording rule Log recording rule corresponding to module;Corresponding log recording is carried out according to log recording rule corresponding to each functional module.
In one embodiment it is proposed that a kind of computer-readable recording medium, is stored thereon with computer instruction, this refers to Order realizes following steps when being executed by processor:Obtain the Function Identification corresponding to the functional module run in server;According to The Function Identification extracts history log record corresponding to each functional module;According to history corresponding to each functional module Log recording counts history error message corresponding to each functional module;Determined and each function according to the history error message Logging level corresponding to module, logging level reflect the fineness of log recording;According to daily record corresponding to each functional module Grade carries out corresponding log recording.
In one embodiment, computer program described in the computing device is to be additionally operable to realize following steps:Obtain Operation duration corresponding to each functional module;Determined and each work(according to the history error message performed by the processor Can logging level corresponding to module, the step of logging level reflects the fineness of log recording includes:According to each work( History error message and operation duration corresponding to energy module determine logging level corresponding to each functional module, logging level reflection The fineness of log recording, higher grade, log recording is finer.
In one embodiment, before the Function Identification corresponding to the functional module included in obtaining server, The processor is additionally operable to perform following steps:The running environment type that detection service device is presently in;According to the operation ring Border type determines logging level division rule corresponding with the running environment type.
In one embodiment, the history log note according to corresponding to each functional module performed by the processor Include corresponding to each functional module of record statistics the step of history error message:According to history corresponding to each functional module Log recording counts each type of error and corresponding error message quantity;Performed by the processor according to described each Error message corresponding to functional module determines logging level corresponding to each functional module, and logging level reflects log recording The step of fineness, includes:Calculated according to type of error message corresponding to each functional module and corresponding error message quantity every Logging level corresponding to individual functional module, logging level reflect the fineness of log recording, and higher grade, and log recording is more smart Carefully.
In one embodiment, logging level corresponding to each functional module of basis performed by the processor carries out phase The step of log recording answered, includes:Each function is determined according to the corresponding relation of default logging level and log recording rule Log recording rule corresponding to module;Corresponding log recording is carried out according to log recording rule corresponding to each functional module.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with The hardware of correlation is instructed to complete by computer program, the computer program can be stored in a computer-readable storage and be situated between In matter, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, foregoing storage medium can be The non-volatile memory mediums such as magnetic disc, CD, read-only memory (Read-Only Memory, ROM), or random storage note Recall body (Random Access Memory, RAM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited In contradiction, the scope that this specification is recorded all is considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneously Can not therefore it be construed as limiting the scope of the patent.It should be pointed out that come for one of ordinary skill in the art Say, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention Scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (10)

1. a kind of log recording method, methods described include:
Obtain the Function Identification corresponding to the functional module run in server;
The history log record according to corresponding to the Function Identification extracts each functional module;
The history error message according to corresponding to history log record corresponding to each functional module counts each functional module;
Logging level corresponding with each functional module is determined according to the history error message, logging level reflects daily record note The fineness of record;
Corresponding log recording is carried out according to logging level corresponding to each functional module.
2. according to the method for claim 1, it is characterised in that methods described also includes:
Obtain operation duration corresponding to each functional module;
Described to determine logging level corresponding with each functional module according to the history error message, logging level reflects day The fineness of will record includes:
The day according to corresponding to history error message and operation duration corresponding to each functional module determine each functional module Will grade, logging level reflect the fineness of log recording, and higher grade, and log recording is finer.
3. according to the method for claim 1, it is characterised in that the functional module included in server is obtained is right Also include before the Function Identification answered:
The running environment type that detection service device is presently in;
Logging level division rule corresponding with the running environment type is determined according to the running environment type.
4. according to the method for claim 1, it is characterised in that the history day according to corresponding to each functional module History error message corresponding to each functional module of will record statistics includes:
Each type of error and corresponding error message are counted according to history log record corresponding to each functional module Quantity;
The error message according to corresponding to each functional module determine each functional module corresponding to logging level, daily record The fineness that grade reflects log recording includes:
Each functional module pair is calculated according to type of error message corresponding to each functional module and corresponding error message quantity The logging level answered, logging level reflect the fineness of log recording, and higher grade, and log recording is finer.
5. according to the method for claim 1, it is characterised in that logging level corresponding to each functional module of basis enters The corresponding log recording of row includes:
The corresponding log recording of each functional module is determined according to the corresponding relation of default logging level and log recording rule Rule;
Corresponding log recording is carried out according to log recording rule corresponding to each functional module.
6. a kind of log recording apparatus, described device include:
Identifier acquisition module, for obtaining the Function Identification corresponding to the functional module run in server;
Extraction module, for the history log record according to corresponding to Function Identification extraction each functional module;
Statistical module, for corresponding to each functional module of history log record statistics according to corresponding to each functional module History error message;
Determining module, for determining logging level corresponding with each functional module, daily record etc. according to the history error message Level reflects the fineness of log recording;
Logging modle, corresponding log recording is carried out for the logging level according to corresponding to each functional module.
7. device according to claim 6, it is characterised in that described device also includes:
Duration acquisition module, for obtaining operation duration corresponding to each functional module;
The determining module is additionally operable to history error message and operation duration according to corresponding to each functional module and determined often Logging level corresponding to individual functional module, logging level reflect the fineness of log recording, and higher grade, and log recording is more smart Carefully.
8. device according to claim 6, it is characterised in that described device also includes:
Detection module, the running environment type being presently in for detection service device;
Regular determining module, for determining logging level corresponding with the running environment type according to the running environment type Division rule.
9. a kind of computer equipment, the computer equipment includes memory, processor and is stored on the memory and can The computer program run on the processor, claim 1-5 is realized described in the computing device during computer program The step of any one methods described.
10. a kind of computer-readable recording medium, is stored thereon with computer instruction, it is characterised in that the instruction is by processor The step of claim 1-5 any one methods describeds are realized during execution.
CN201710488996.9A 2017-06-23 2017-06-23 Log recording method and device, computer equipment and storage medium Active CN107678908B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710488996.9A CN107678908B (en) 2017-06-23 2017-06-23 Log recording method and device, computer equipment and storage medium
PCT/CN2017/108061 WO2018233170A1 (en) 2017-06-23 2017-10-27 Method, device, computer device, and storage medium for recording a log

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710488996.9A CN107678908B (en) 2017-06-23 2017-06-23 Log recording method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN107678908A true CN107678908A (en) 2018-02-09
CN107678908B CN107678908B (en) 2020-07-31

Family

ID=61133915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710488996.9A Active CN107678908B (en) 2017-06-23 2017-06-23 Log recording method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN107678908B (en)
WO (1) WO2018233170A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144836A (en) * 2018-08-06 2019-01-04 阿里巴巴集团控股有限公司 A kind of processing method of operation log, device and electronic equipment
CN109324970A (en) * 2018-09-28 2019-02-12 平安普惠企业管理有限公司 SDK running environment detection method, device, computer equipment and storage medium
CN110351126A (en) * 2019-06-26 2019-10-18 中信百信银行股份有限公司 Log rank method of adjustment, device and electronic equipment
CN110932904A (en) * 2019-11-29 2020-03-27 新华三半导体技术有限公司 Key log recording method and device and network equipment
CN111010290A (en) * 2019-11-22 2020-04-14 泰康保险集团股份有限公司 Service log processing method and device, electronic equipment and storage medium
CN111786828A (en) * 2020-06-29 2020-10-16 百度在线网络技术(北京)有限公司 Log processing method executed in network device and network device
CN112491584A (en) * 2020-11-04 2021-03-12 贝壳技术有限公司 Service operation safety condition judging method, device, electronic medium and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593148A (en) * 2009-04-15 2009-12-02 卡斯柯信号有限公司 A kind of dynamic multi-output log processing system
CN103645982A (en) * 2013-11-29 2014-03-19 北京奇虎科技有限公司 Log processing method and client
CN105528280A (en) * 2015-11-30 2016-04-27 中电科华云信息技术有限公司 Method and system capable of determining log alarm grades according to relationship between system logs and health monitoring

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9336119B2 (en) * 2013-11-25 2016-05-10 Globalfoundries Inc. Management of performance levels of information technology systems
CN104935444B (en) * 2014-03-17 2018-09-04 新华三技术有限公司 Isomery log system management configuration device and method
CN106156355B (en) * 2016-07-27 2019-02-01 腾讯科技(深圳)有限公司 Log processing method and device
CN106775929B (en) * 2016-11-25 2019-11-26 中国科学院信息工程研究所 A kind of virtual platform safety monitoring method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593148A (en) * 2009-04-15 2009-12-02 卡斯柯信号有限公司 A kind of dynamic multi-output log processing system
CN103645982A (en) * 2013-11-29 2014-03-19 北京奇虎科技有限公司 Log processing method and client
CN105528280A (en) * 2015-11-30 2016-04-27 中电科华云信息技术有限公司 Method and system capable of determining log alarm grades according to relationship between system logs and health monitoring

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144836A (en) * 2018-08-06 2019-01-04 阿里巴巴集团控股有限公司 A kind of processing method of operation log, device and electronic equipment
CN109324970A (en) * 2018-09-28 2019-02-12 平安普惠企业管理有限公司 SDK running environment detection method, device, computer equipment and storage medium
CN110351126A (en) * 2019-06-26 2019-10-18 中信百信银行股份有限公司 Log rank method of adjustment, device and electronic equipment
CN111010290A (en) * 2019-11-22 2020-04-14 泰康保险集团股份有限公司 Service log processing method and device, electronic equipment and storage medium
CN111010290B (en) * 2019-11-22 2022-11-29 泰康保险集团股份有限公司 Service log processing method and device, electronic equipment and storage medium
CN110932904A (en) * 2019-11-29 2020-03-27 新华三半导体技术有限公司 Key log recording method and device and network equipment
CN110932904B (en) * 2019-11-29 2022-08-09 新华三半导体技术有限公司 Key log recording method and device and network equipment
CN111786828A (en) * 2020-06-29 2020-10-16 百度在线网络技术(北京)有限公司 Log processing method executed in network device and network device
CN111786828B (en) * 2020-06-29 2023-07-11 百度在线网络技术(北京)有限公司 Log processing method executed in network equipment and network equipment
CN112491584A (en) * 2020-11-04 2021-03-12 贝壳技术有限公司 Service operation safety condition judging method, device, electronic medium and storage medium
CN112491584B (en) * 2020-11-04 2022-05-20 贝壳技术有限公司 Service operation safety condition judgment method and device, electronic medium and storage medium

Also Published As

Publication number Publication date
WO2018233170A1 (en) 2018-12-27
CN107678908B (en) 2020-07-31

Similar Documents

Publication Publication Date Title
CN107678908A (en) Log recording method, device, computer equipment and storage medium
CN104756106B (en) Data source in characterize data storage system
US8655623B2 (en) Diagnostic system and method
US7676695B2 (en) Resolution of computer operations problems using fault trend analysis
US20180329977A1 (en) Cluster evaluation in unsupervised learning of continuous data
CN110262458A (en) Fault characteristic information extracts the method and system with initial failure early warning
CN104021264A (en) Defect prediction method and device
CN102955902B (en) Method and system for evaluating reliability of radar simulation equipment
CN102637178A (en) Music recommending method, music recommending device and music recommending system
CN110347561B (en) Monitoring alarm method and terminal equipment
CN109495291B (en) Calling abnormity positioning method and device and server
CN106445938B (en) Data detection method and device
CN109102206A (en) A kind of evaluation method and relevant device of Automobile Service Factory
CN108734304A (en) A kind of training method of data model, device and computer equipment
WO2022252512A1 (en) Root cause analysis method and apparatus, electronic device, medium, and program
US20170171041A1 (en) System capacity heatmap
US11182436B2 (en) Predicting locations based on transaction records
CN113590432A (en) Database inspection method and device
US10275408B1 (en) Analysis and visualization tool utilizing mixture of multiple reliability measures for product and part combinations
CN105429792A (en) User behavior flow obtaining method and device and user behavior analysis method and system
US10346482B1 (en) Context- and activity-aware content selection
CN113886373A (en) Data processing method and device and electronic equipment
CN109426592A (en) A kind of disk detection method
CN109409091B (en) Method, device and equipment for detecting Web page and computer storage medium
CN103116708A (en) Device and method for evaluating website experience

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
GR01 Patent grant
GR01 Patent grant