CN105868391B - A kind of method and apparatus of log recording - Google Patents

A kind of method and apparatus of log recording Download PDF

Info

Publication number
CN105868391B
CN105868391B CN201610237814.6A CN201610237814A CN105868391B CN 105868391 B CN105868391 B CN 105868391B CN 201610237814 A CN201610237814 A CN 201610237814A CN 105868391 B CN105868391 B CN 105868391B
Authority
CN
China
Prior art keywords
log
daily record
record data
configuration file
journal
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.)
Active
Application number
CN201610237814.6A
Other languages
Chinese (zh)
Other versions
CN105868391A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610237814.6A priority Critical patent/CN105868391B/en
Publication of CN105868391A publication Critical patent/CN105868391A/en
Application granted granted Critical
Publication of CN105868391B publication Critical patent/CN105868391B/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/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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of method and devices of log recording, which comprises obtains daily record data, includes that log rank and characteristic information identify in the daily record data;When preset configuration file corresponding there are some log rank, the other daily record data of corresponding journal stage is written in the configuration file;And according to the corresponding daily record data of characteristic information mark tissue in the configuration file.The above method and device of the invention can improve positioning log and report the efficiency of abnormal log on the basis of reducing daily record data storage resource occupancy.

Description

A kind of method and apparatus of log recording
The application be the applying date be September in 2012 25, application No. is a kind of 201210361884.4, entitled " logs The divisional application of the Chinese invention patent application of the method and apparatus of record ".
Technical field
The present invention relates to file processing technology fields, and in particular to a kind of method of log recording and a kind of log recording Device.
Background technique
The network equipment, system and service routine etc. can all generate the logout for being log (log) in running; Every a line log all recites the description of the relevant operations such as date, time, user and movement.Log is to look at system operation shape The main foundation of state and investigation problem.Log can be used to the record of service operation process on line and run the monitoring of program, It can be prompted, be alerted for the mistake for occurring and being likely to occur by the log of analysis record, can be identified with statistical service Information is improved for service logic and application program updating provides reliable foundation.For example, application program collapses in some software Routed situation, then corresponding record can be found from program event log, to help to analyze and solve the problems, such as.
In the prior art, the content of log recording is usually magnanimity, with inline systems such as electronic fare payment systems For log recording, a payment transaction often generates a plurality of log recording, also, the note that concurrent more transactions generate Often intersecting is recorded for record, in this case, related technical personnel if it is intended to some in inquiry system or The operating condition of certain several functional module, or the efficiency checked to the problem of some error is relatively low, for example, user needs Does which service system have invoked whithin a period of time for inquiry, what kind of is the calling sequence of service? the failure alarms that system is dished out Which does the module being related to have? do are these modules all which kind of recovery operations taken? it, be from system day in the situation that log amount is larger Above- mentioned information are inquired in many and diverse information of will, it is clear that are the processes taken time and effort very much.
Therefore, how innovatively a technical problem that needs to be urgently solved by technical personnel in the field at present is exactly: A kind of method for proposing log recording, to reduce daily record data storage resource occupy on the basis of, improve positioning log and Report the efficiency of abnormal log.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind The method for stating a kind of log recording of problem, and a kind of corresponding device of log recording.
According to one aspect of the present invention, a kind of method of log recording is provided, comprising: daily record data is obtained, it is described It include that log rank and characteristic information identify in daily record data;When preset configuration file corresponding there are some log rank, The other daily record data of corresponding journal stage is written in the configuration file;Tissue is identified according to characteristic information in the configuration file Corresponding daily record data.
According to another aspect of the present invention, a kind of device of log recording is provided, including daily record data obtains module, day Will file detection module, log writing module and daily record data tissue module: the daily record data obtains module for obtaining Daily record data includes that log rank and characteristic information identify in the daily record data;The journal file detection module is for sentencing It is disconnected to whether there is the corresponding preset configuration file of some log rank, if so, calling log writing module;The log write-in Module is for the other daily record data of corresponding journal stage to be written in the configuration file;And the daily record data tissue module is used for According to the corresponding daily record data of characteristic information mark tissue in the configuration file.
Corresponding configuration text is written during log recording, by the daily record data for meeting log level conditions in the present invention In part, preset process can be scanned the configuration file and initiate the prompting processing of abnormal log, while all Daily record data will identify according to characteristic information and carry out tissue, to improve positioning log and report the efficiency of abnormal log.
Just for some or certain several journal stages in all log ranks not She Zhi configuration file in the case where, this Inventive embodiments can effectively reduce the occupied memory space of journal file.And by way of journal file dynamic configuration, So that the management of log is more flexible, thus guarantee that stored information in journal file is largely valuable information, For the operation of user query log, it is also beneficial to the raising of user's operation efficiency.
Above description is only the general introduction of technical solution of the present invention, in order to better understand technology hand of the invention Section, and can be implemented in accordance with the contents of the specification, and in order to allow the above and other purposes of the present invention, feature and advantage It can be more clearly understood, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
The step process that Fig. 1 shows a kind of embodiment of the method 1 of log recording according to an embodiment of the invention is shown It is intended to;
Fig. 2 shows a kind of step processes of the embodiment of the method 2 of log recording according to an embodiment of the invention to show It is intended to;
Fig. 3 shows a kind of structural block diagram of the Installation practice of log recording according to an embodiment of the invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
One of the core concepts of the embodiments of the present invention will meet the day of log level conditions during log recording Will data are written in corresponding configuration file, and preset process can be scanned the configuration file and initiate abnormal log Prompting processing, while all daily record datas will identify according to characteristic information and carry out tissue, to improve positioning log and report Accuse the efficiency of abnormal log.
Referring to Fig.1, it illustrates a kind of step flow diagram of the embodiment of the method 1 of log recording of the invention, tools Body may include steps of:
Step 101, daily record data is obtained, includes that log rank and characteristic information identify in the daily record data;
In one preferred embodiment of the invention, the log rank can be by those skilled in the art according to practical feelings Condition is configured.For example, all available ranks of configuration log are as follows: INFO, DEBUG, ERROR, WARN, FATAL;Wherein, INFO refers to the operating point and result of all keys;DEBUG refers to some debugging letter opened to debug whole system Breath, when system stable operation, can close the information;ERROR indicates that some mistakes have occurred in system, by the letter of mistake Breath is recorded;WARN refers to record and work as system close to some Critical value resources or to have had already appeared some resources inadequate With or system mistake, be temporarily also unlikely to influence whole system operation but needs cause concern information;FATAL is indicated There is very serious problem, needs the information of halt system.Or such as, a kind of semiconductor factory's apparatus control system day is configured All available ranks of will are as follows: Verbose (details), Event (event), Problem (problem), Error (mistake), Five ranks of Fatal (fatal error).
As a kind of example of concrete application in transaction platform of the embodiment of the present invention, the characteristic information mark can be The transaction journal number of every transaction in transaction platform.
It is well known that transaction platform is commonly used in handing between consumer, businessman and financial institution using safe electronic means Commodity or service are changed, i.e., novel means of payment (including electronic cash (E-CASH), credit card (CREDIT CARD), debit card (DEBIT CARD), smart card etc.) payment information bank or corresponding processing mechanism are transmitted to by network security, with realize E-payment.
The characteristics of based on the above transaction platform, inventor herein have found that the log of transaction platform needs to meet need below It asks:
1, information covering point needs comprehensive: because transaction platform is related to money, then the requirement for safety will be very Height, since transaction platform can record the flow direction of fund in a manner of electronic money, so, system should be to each crucial position The operating process and result set all are recorded, so as to support the retrieval to transaction whole process, once some part is sent out Problem has been given birth to, quickly orientation problem can be apparent, has found the generation point of failure or mistake.
2, log recording needs to simplify as far as possible: excessively detailed log recording, and the I/O of biggish read-write disk can be brought to hold Pin, in this way can affect entire transaction platform, cause period of reservation of number too long, user experience is very poor, so log is same When need to meet the requirement simplified as far as possible.
3, log recording needs main line: the completion of a transaction usually has multiple interaction, often generates a plurality of log Record, these records are frequently not what continuity recorded, can be recorded in inside journal file by interspersed, especially support high concurrent Under the design of demand, payment system is often using multi-threaded I/O multiplexing framework model, while concurrent more transactions produce Often intersecting is recorded for raw record.
The a plurality of log recording traded due to one can be recorded in inside journal file by interspersed, so needing unique Sequence number identifies current transaction.In one preferred embodiment of the invention, the characteristic information mark can be handed over to be current Easy serial number, because every transaction needs oneself unique serial number in transaction platform and is identified, and companion A unique characteristic information identification number is also required to each log that the transaction generates to be identified, they have identical Demand and feature use the transaction journal number of transaction platform as the feature in daily record data therefore in embodiments of the present invention Message identification.The transaction journal number has its corresponding rule, for example, the transaction journal number can be according to server The MAC Address of network interface card records time and generating random number.To guarantee that transaction journal number has opposite uniqueness, at one section In time, it will not repeat on different machines.
In the concrete realization, the daily record data can be by the way of recording, in embodiments of the present invention line by line, every row Daily record data all includes at least log rank and characteristic information mark.
Step 102, when preset configuration file corresponding there are some log rank, by the other log number of corresponding journal stage According in the write-in configuration file.
In one preferred embodiment of the invention, the log rank has mark, and the preset configuration file can be with For the configuration file that filename is arranged according to the log level identification;In this case, the step 102 may include as Lower sub-step:
Sub-step S11 was checked under specified directory with the presence or absence of matching with the filename comprising corresponding log level identification Set file;If so, executing sub-step S12, sub-step S13 is otherwise executed;
The other daily record data of corresponding journal stage is written in corresponding configuration file sub-step S12;
The daily record data is not written in sub-step S13 in configuration file.
For example, it is assumed that all available ranks of log are as follows: INFO, DEBUG, ERROR, WARN, FATAL, corresponding log Level identification are as follows: INFO, DEBUG, ERROR, WARN, FATAL, preset configuration file include ERROR.xxx, WARN.xxx, FATAL.xxx, it is assumed that when including log rank INFO in previous daily record data, check the configuration for finding no respective file name File does not need then to record this daily record data in configuration file.Assuming that including log in current another daily record data Rank ERROR, there are the configuration file ERROR.xxx of respective file name for retrieval discovery, and then this daily record data is written In this file of ERROR.xxx.
It in another preferred embodiment of the invention, can also include service identification information, institute in the daily record data Stating log rank has mark, and the preset configuration file can include the service identification information and log rank for filename The configuration file of mark.In this case, the step 102 may include following sub-step:
Sub-step S21, checking, which whether there is to have under specified directory, includes corresponding service identification information and log rank mark The configuration file of the filename of knowledge;If so, executing sub-step S22, sub-step S23 is otherwise executed;
The other daily record data of corresponding journal stage is written in corresponding configuration file sub-step S22.
The daily record data is not written in sub-step S23 in configuration file.
For example, it is assumed that all available ranks of log include: INFO, DEBUG, ERROR, WARN, FATAL, corresponding day Will level identification are as follows: INFO, DEBUG, ERROR, WARN, FATAL, available service identification information include: gathering business RecvService, preset configuration file include RecvService_WARN_log.xxx, RecvService_FATAL_ Log.xxx, it is assumed that when including service identification information RecvService and log rank INFO in previous daily record data, check It was found that the configuration file of no respective file name, does not need then to record this daily record data in configuration file.Assuming that current It include service identification information RecvService and log rank WARN in another daily record data, retrieval discovery has corresponding text Then RecvService_ is written in this daily record data by the configuration file RecvService_WARN_log.xxx of part name In this file of WARN_log.xxx.
According to above-mentioned example it is appreciated that whether the daily record data needs to be written in configuration file to configure. In the concrete realization, the configuration that filename is identified as using service identification information and log rank can be created under specified directory File, i.e., there are corresponding services and the other configuration file of journal stage under specified directory, then just carrying out this daily record data Record;It is on the contrary then do not record.For example for: if service identification information is service, specified Log Directory is/ Log/service/ has INFO journal stage if there are service_INFO_log.xxxx files under this catalogue Other daily record data will be written into service_INFO_log.xxxx file;If existed under this catalogue Service_ERROR_log.xxxx file, then having the other daily record data of error journal stage that will be written into service_ In ERROR_log.xxxx file.That is, whether there is the configuration file of the same name with some log rank, or, if In the presence of the configuration file of the same name with some service identification information and log rank, just it is whether to record the daily record data of the rank Switch, system can judge it when each record log, to realize dynamic log configuration feature.
Certainly, the set-up mode of above-mentioned configuration file is solely for example, in practice, can also be set using other way The configuration file is set, for example, creation includes service identification information under specified directory, log level identification and record date The configuration file of filename will then meet the service identification information, log level identification and record date in this case Logdata record in corresponding configuration file;Those skilled in the art are feasible using setting according to actual conditions , the present invention is to this without limiting.
Just for some or certain several journal stages in all log ranks not She Zhi configuration file in the case where, this Inventive embodiments can effectively reduce the occupied memory space of journal file.And a kind of mode of flexible configuration in this way, So that the management of log is more flexible, thus guarantee that stored information in journal file is largely valuable information, For the operation of user query log, it is also beneficial to the raising of user's operation efficiency.
Above-mentioned configuration file can be used for being scanned by default process, to carry out abnormal log prompting processing.Specific real In existing, an independent process (default process) can be set and go to scan the configuration file.The default process can be one A daemon, daemon are a kind of life cycle long processes.They are usually started when System guides are packed into, and are closed in system Termination when closing.It is a kind of process of not controlling terminal in running background.
Then daemon can go to alarm to prompt user with timing scan configuration file according to severity level The situation of abnormal log.For example, issuing mail when scanning error log and alarming;When scan warning log or When indicating log, issues mail and short message is alarmed.Because daemon is in the configuration file of timing scan log, it It can find failed transactions, issue alarm, may include the machine IP that mistake occurs, Log Names and generation mistake in warning information Transaction odd numbers.After operation maintenance personnel obtains warning information, the error log can be quickly found because error log often compared with It is few, the place for recording transaction failure can be found from error log quickly, then can position according to log information is Problem occurs for which step.
Certainly, above only to illustrate to the processing mode of the abnormal log, those skilled in the art are according to real Border situation is arbitrarily arranged, the invention is not limited in this regard.
Step 103, according to the corresponding daily record data of characteristic information mark tissue in the configuration file.
The inventor of this patent is also noted that the recording mode of log can largely influence user to letter of interest The acquisition of breath.A kind of log recording mode that format is apparent can allow user quickly to position its information of interest, and disorderly and unsystematic Record format can then allow user effort many times, to reduce the working efficiency of user.It is apparent to establish a kind of format Log recording mode, the log recording mode of the embodiment of the present invention require in the configuration file according to characteristic information mark group Corresponding daily record data is knitted, by taking the application in transaction platform as an example, organizes corresponding daily record data then can be with by transaction journal number More daily record datas of rambling same transaction are arranged together.
Specifically, transaction journal number can be classified as to the field on the longitudinal axis, by other data such as log rank, when record Between etc. be classified as field on horizontal axis, when user inquires, then can pass through multiple critical fielies such as horizontally and vertically It is inquired, because having multiple row on horizontal axis, column analysis tool awk etc. can be used and be filtered analysis, can also import It is analyzed again after database, because daily record data has corresponding field, such as log rank, time etc. is recorded, so importing The work of database is also very simple.Using the embodiment of the present invention, allow user in the spy for inquiring certain context relation When reference ceases, can locating query faster more quasi-ly, to further improve the efficiency of user query log.
Referring to Fig. 2, it illustrates a kind of step flow diagram of the embodiment of the method 2 of log recording of the invention, tools Body may include steps of:
Step 201, daily record data is obtained, the daily record data is the daily record data recorded line by line, every row daily record data tool Body includes at least one of following information: progress information, thread information, service identification information, characteristic information identify (such as transaction flow Water number), record time, log rank and business operation information.
For example, the content of a logdata record are as follows:
[10910][1166063936][1************145]20120810 00:00: 07.995INFO@********success!
Wherein, [10910] be process number (progress information), [1166063936] be thread number (thread information), it is described into Journey number and thread number have recorded some information when system operation respectively, and the api interface that can be specifically provided by system obtains. [1************145] is characteristic information mark, such as the transaction journal number in transaction platform, 20120810 00:00: 07.995 is the record time, can specifically be recorded using timestamp, the precision of timestamp can achieve Millisecond, in high concurrent In the case where, timestamp can be used to more clearly distinguish each daily record data.INFO indicates log rank, * * * * * * * * success!What is recorded is the practical operation information of execution business, and the specific process (thread) including system is in this time Whether successfully etc. what point done on earth, this thing done contents.
Step 202, when preset configuration file corresponding there are some log rank, by the other log number of corresponding journal stage According in the write-in configuration file;
Step 203, according to the corresponding daily record data of characteristic information mark tissue in the configuration file;
Step 204, it by the daily record data according to characteristic information mark tissue, is arranged according to the record time Sequence.
Wherein, above-mentioned configuration file can be used for being scanned by default process, to carry out abnormal log prompting processing.
In order to enable those skilled in the art to better understand the present invention, it is illustrated below by way of a specific example.
For example, the user on the 30th of August in 2012, which has submitted one in transaction platform, supplements application, the first step with money, the transaction is put down The front end system of platform first judge the user submit request belong to which business (in practice, business may include a variety of, such as receive The business such as money, payment, transaction), it is assumed that is called here is registerReceivable (registration charge slip), and system is basis Business carrys out sectional lists single cent part log data, is currently gathering business, then selects the Log Directory of gathering business RecvService;Second step obtains current system time, and system can be one day record, one journal file, then system is fixed The current Log Directory [20120829] in position is simultaneously written;Third step, system judge log rank, and supplementing application with money is a normal day Will, rank are INFO, then select RecvService_INFO_log.20120829 file, are not not written into the configuration file then; 4th step, system obtain transaction journal 0AA00005EC38B2012082900221487185, obtain process ID number and thread ID number;Current business operation information is such as received request by the 5th step, and the original message of request is recorded, this is arrived, institute There is information collection to finish, log recording as follows generated in RecvService_INFO_log.20120829 file:
[21646][1148803392][0AA00005EC38B2012082800221487185]20120829 10:17: 37.080INFO@input para:inRecv.userId=247156217333, inRecv.subAccountType=0, InRecv.recvType=96, inRecv.state=2, inRecv.bankUserId=46912518488200, XXX.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method It closes, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described, because according to this hair Bright, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know that, specification Described in embodiment belong to preferred embodiment, it is related that actions and modules are not necessarily necessary for the present invention.
Referring to Fig. 3, a kind of structural frames of the Installation practice of log recording according to an embodiment of the invention are shown Figure, can specifically include with lower module:
Daily record data obtains module 301, includes log rank and feature in the daily record data for obtaining daily record data Message identification;
Journal file detection module 302, for judging whether there is the corresponding preset configuration file of some log rank, if It is then to call log writing module 303;
Log writing module 303, for the other daily record data of corresponding journal stage to be written in the configuration file;
Daily record data tissue module 304, for identifying tissue corresponding day according to characteristic information in the configuration file Will data.
It in one preferred embodiment of the invention, can also include the record time in the daily record data;The dress Set to include following module:
Sorting module, for by it is described according to characteristic information mark tissue daily record data, according to the record time into Row sequence.
Wherein, above-mentioned configuration file can be used for being scanned by default process, to carry out abnormal log prompting processing.
As a kind of example of concrete application of the embodiment of the present invention, described device is used for the log recording of transaction platform, institute Stating characteristic information mark can be the transaction journal number of every transaction in transaction platform.
In one preferred embodiment of the invention, the log rank has mark, and the preset configuration file can be with For the configuration file in filename including the log level identification.
It in another preferred embodiment of the invention, further include service identification information in the daily record data, the day Will rank has mark, and the preset configuration file can include the service identification information and log level identification for filename Configuration file.
In the concrete realization, can also be comprised at least one of the following in the daily record data: progress information, thread information, And business operation information.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple Place illustrates referring to the part of embodiment of the method.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed Meaning one of can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice Microprocessor or digital signal processor (DSP) realize one in file protection processing equipment according to an embodiment of the present invention The some or all functions of a little or whole components.The present invention is also implemented as executing method as described herein Some or all device or device programs (for example, computer program and computer program product).Such realization Program of the invention can store on a computer-readable medium, or may be in the form of one or more signals.This The signal of sample can be downloaded from an internet website to obtain, and is perhaps provided on the carrier signal or mentions in any other forms For.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame Claim.
The embodiment of the invention discloses A1, a kind of method of log recording, comprising:
Daily record data is obtained, includes that log rank and characteristic information identify in the daily record data;
It, should by the other daily record data write-in of corresponding journal stage when preset configuration file corresponding there are some log rank In configuration file;And
According to the corresponding daily record data of characteristic information mark tissue in the configuration file.
A2, the method as described in claim A1 further include the record time in the daily record data, the log recording Method further include:
By the daily record data according to characteristic information mark tissue, it is ranked up according to the record time.
A3, the method as described in claim A1 or A2, the method are used for the log recording of transaction platform, the feature Message identification is the transaction journal number of every transaction in transaction platform.
A4, the method as described in any one of claim A1-A3, the log rank has mark, described preset to match Setting file is the configuration file in filename comprising the log level identification.
A5, the method as described in any one of claim A1-A4, it is described when there are some log rank is corresponding preset When configuration file, further comprise by the step that the other daily record data of corresponding journal stage is written in corresponding configuration file:
It checks under specified directory with the presence or absence of the configuration file with the filename comprising corresponding log level identification;And
If so, the other daily record data of corresponding journal stage is written in corresponding configuration file.
A6, the method as described in any one of claim A1-A5 further include service identification letter in the daily record data Breath, the log rank have mark, and the preset configuration file is that filename includes the service identification information log rank The configuration file of mark.
A7, the method as described in any one of claim A1-A6, it is described when there are some log rank is corresponding preset When configuration file, further comprise by the step that the other daily record data of corresponding journal stage is written in corresponding configuration file:
It checks under specified directory with the presence or absence of with the filename comprising corresponding service identification information and log level identification Configuration file;And
If so, the other daily record data of corresponding journal stage is written in corresponding configuration file.
A8, the method as described in any one of claim A1-A7 further include following at least one in the daily record data Kind: progress information, thread information and business operation information.
The embodiment of the invention also discloses B9, a kind of device of log recording, including daily record data to obtain module, log text Part detection module, log writing module and daily record data tissue module:
The daily record data obtains module for obtaining daily record data, includes log rank and feature in the daily record data Message identification;
The journal file detection module is used to judge whether there is the corresponding preset configuration file of some log rank, if It is then to call log writing module;
The log writing module is for the other daily record data of corresponding journal stage to be written in the configuration file;And
The daily record data tissue module was used in the configuration file according to characteristic information mark tissue corresponding day Will data.
B10, the device as described in claim B9 further include the record time in the daily record data, the log note Recording device further includes sorting module:
The sorting module is used for by the daily record data according to characteristic information mark tissue, according to the record time It is ranked up.
B11, the device as described in claim B9 or B10, the device of the log recording are used for the log of transaction platform Record, the characteristic information are identified as the transaction journal number of every transaction in transaction platform.
B12, the device as described in any one of claim B9-B11, the log rank has mark, described preset Configuration file is the configuration file in filename comprising the log level identification.
B13, the device as described in any one of claim B9-B12, in which:
The journal file detection module is further used for checking under specified directory with the presence or absence of with comprising corresponding log The configuration file of the filename of level identification, if so, calling the log writing module;And
The log writing module is further used for the other daily record data write-in filename of corresponding journal stage including described In the configuration file of corresponding log level identification.
B14, the device as described in any one of claim B9-B13 further include service identification letter in the daily record data Breath, the log rank have mark, and the preset configuration file is that filename includes the service identification information and journal stage The configuration file not identified.
B15, the device as described in any one of claim B9-B14, in which:
The journal file detection module is further used for checking under specified directory with the presence or absence of with comprising corresponding service The configuration file of the filename of identification information and log level identification, if so, calling the log writing module;And
The log writing module is further used for the other daily record data write-in filename of corresponding journal stage including described In the configuration file of service identification information and the log level identification.
B16, the device as described in any one of claim B9-B15 further include following at least one in the daily record data Kind: progress information, thread information and business operation information.

Claims (16)

1. a kind of method of log recording, comprising:
Daily record data is obtained, includes that log rank and characteristic information identify in the daily record data;
When preset configuration file corresponding there are some log rank, the configuration is written into the other daily record data of corresponding journal stage In file, the configuration file is the configuration text not being arranged for some or certain several journal stages in all log ranks Part;And
According to the corresponding daily record data of characteristic information mark tissue in the configuration file.
It further include the record time in the daily record data, the method for the log recording is also 2. the method as described in claim 1 Include:
By the daily record data according to characteristic information mark tissue, it is ranked up according to the record time.
3. method according to claim 1 or 2, the method is used for the log recording of transaction platform, the characteristic information mark Know the transaction journal number for every transaction in transaction platform.
4. the method as described in any one of claims 1 or 2, the log rank has mark, the preset configuration file For the configuration file in filename including the log level identification.
5. the method as described in any one of claims 1 or 2, described when there are the corresponding preset configuration texts of some log rank When part, further comprise by the step that the other daily record data of corresponding journal stage is written in corresponding configuration file:
It checks under specified directory with the presence or absence of the configuration file with the filename comprising corresponding log level identification;And
If so, the other daily record data of corresponding journal stage is written in corresponding configuration file.
It further include service identification information in the daily record data 6. the method as described in any one of claims 1 or 2, it is described Log rank has mark, and the preset configuration file is that filename includes matching for the service identification information log level identification Set file.
7. the method as described in any one of claims 1 or 2, described when there are the corresponding preset configuration texts of some log rank When part, further comprise by the step that the other daily record data of corresponding journal stage is written in corresponding configuration file:
It checks under specified directory with the presence or absence of matching with the filename comprising corresponding service identification information and log level identification Set file;And
If so, the other daily record data of corresponding journal stage is written in corresponding configuration file.
It further include following at least one: process in the daily record data 8. the method as described in any one of claims 1 or 2 Information, thread information and business operation information.
9. a kind of device of log recording, including daily record data obtain module, journal file detection module, log writing module, And daily record data tissue module:
The daily record data obtains module for obtaining daily record data, includes log rank and characteristic information in the daily record data Mark;
The journal file detection module is described to match for judging whether there is the corresponding preset configuration file of some log rank Setting file is the configuration file not being arranged for some or certain several journal stages in all log ranks, if so, calling Log writing module;
The log writing module is for the other daily record data of corresponding journal stage to be written in the configuration file;And
The daily record data tissue module is used in the configuration file according to the corresponding log number of characteristic information mark tissue According to.
It further include record time, the log recording apparatus in the daily record data 10. device as claimed in claim 9 Further include sorting module:
The sorting module is used to carry out the daily record data according to characteristic information mark tissue according to the record time Sequence.
11. the device as described in claim 9 or 10, the device of the log recording is used for the log recording of transaction platform, institute State the transaction journal number that characteristic information is identified as every transaction in transaction platform.
12. the device as described in any one of claim 9 or 10, the log rank has mark, the preset configuration text Part is the configuration file in filename comprising the log level identification.
13. the device as described in any one of claim 9 or 10, in which:
The journal file detection module is further used for checking under specified directory with the presence or absence of with comprising corresponding log rank The configuration file of the filename of mark, if so, calling the log writing module;And
The log writing module is further used for the other daily record data write-in filename of corresponding journal stage including described corresponding In the configuration file of log level identification.
It further include service identification information in the daily record data 14. the device as described in any one of claim 9 or 10, institute Stating log rank has mark, and the preset configuration file is that filename includes the service identification information and log level identification Configuration file.
15. the device as described in any one of claim 9 or 10, in which:
The journal file detection module is further used for checking under specified directory with the presence or absence of with comprising corresponding service mark The configuration file of the filename of information and log level identification, if so, calling the log writing module;And
The log writing module is further used for the other daily record data write-in filename of corresponding journal stage including the business In the configuration file of identification information and the log level identification.
Further include following at least one in the daily record data 16. the device as described in any one of claim 9 or 10: into Journey information, thread information and business operation information.
CN201610237814.6A 2012-09-25 2012-09-25 A kind of method and apparatus of log recording Active CN105868391B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610237814.6A CN105868391B (en) 2012-09-25 2012-09-25 A kind of method and apparatus of log recording

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210361884.4A CN102902764B (en) 2012-09-25 2012-09-25 A kind of method and apparatus of log recording
CN201610237814.6A CN105868391B (en) 2012-09-25 2012-09-25 A kind of method and apparatus of log recording

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201210361884.4A Division CN102902764B (en) 2012-09-25 2012-09-25 A kind of method and apparatus of log recording

Publications (2)

Publication Number Publication Date
CN105868391A CN105868391A (en) 2016-08-17
CN105868391B true CN105868391B (en) 2019-06-04

Family

ID=47574996

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201610237814.6A Active CN105868391B (en) 2012-09-25 2012-09-25 A kind of method and apparatus of log recording
CN201210361884.4A Expired - Fee Related CN102902764B (en) 2012-09-25 2012-09-25 A kind of method and apparatus of log recording

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201210361884.4A Expired - Fee Related CN102902764B (en) 2012-09-25 2012-09-25 A kind of method and apparatus of log recording

Country Status (1)

Country Link
CN (2) CN105868391B (en)

Families Citing this family (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103152391B (en) * 2013-01-31 2016-08-10 杭州华三通信技术有限公司 A kind of log-output method and device
CN104144071B (en) * 2013-05-10 2018-02-06 北京新媒传信科技有限公司 The processing platform of the processing method and system daily record of system journal
CN103337113B (en) * 2013-07-17 2015-05-13 广州广电运通金融电子股份有限公司 Method and device for intelligently analyzing electronic day-to-day journals, as well as processor
CN104572781B (en) * 2013-10-29 2018-10-23 中国银联股份有限公司 A kind of transaction log production method and device
CN103984621B (en) * 2014-04-01 2017-08-11 广州杰赛科技股份有限公司 log separation method and system
US10127301B2 (en) 2014-09-26 2018-11-13 Oracle International Corporation Method and system for implementing efficient classification and exploration of data
CN104298586A (en) * 2014-10-15 2015-01-21 青岛海尔软件有限公司 Web system exception analytical method and device based on system log
CN106161066A (en) * 2015-04-13 2016-11-23 中国移动通信集团福建有限公司 A kind of log collection method and server
CN106484742A (en) * 2015-09-01 2017-03-08 北京国双科技有限公司 Log processing method and device
CN105119762A (en) * 2015-09-23 2015-12-02 普元信息技术股份有限公司 System and method of cloud platform for realizing transaction playback and transaction reworking based on logs
CN107332680A (en) * 2016-04-28 2017-11-07 苏宁云商集团股份有限公司 A kind of system monitoring method and device
CN106161087A (en) * 2016-06-28 2016-11-23 浪潮(北京)电子信息产业有限公司 The network interface card error event collection method of a kind of linux system and system
CN106296400A (en) * 2016-08-10 2017-01-04 中国农业银行股份有限公司 A kind of method and system of log recording
CN106383781B (en) * 2016-09-05 2020-02-14 中国银行股份有限公司 Method and device for realizing code analysis
CN106484593A (en) * 2016-09-29 2017-03-08 北京小米移动软件有限公司 Log processing method, device and electronic equipment
CN108062323B (en) * 2016-11-08 2021-10-15 北京国双科技有限公司 Log reading method and device
CN106776255B (en) * 2016-12-20 2020-09-04 Tcl科技集团股份有限公司 Log extraction method and device of smart television system
CN107103470B (en) * 2017-03-03 2021-08-13 九次方大数据信息集团有限公司 Method and system for improving information security in spot transaction process
CN107229555B (en) * 2017-05-04 2021-07-20 北京星选科技有限公司 Identification generation method and device
CN107153695A (en) * 2017-05-05 2017-09-12 恒生电子股份有限公司 Log recording method and device, electronic equipment, storage medium
CN107315779A (en) * 2017-06-05 2017-11-03 海致网络技术(北京)有限公司 Log analysis method and system
CN107273280B (en) * 2017-06-30 2021-02-09 百度在线网络技术(北京)有限公司 Log processing method and device, electronic equipment and storage medium
CN110020041B (en) * 2017-08-21 2021-10-08 北京国双科技有限公司 Method and device for tracking crawling process
CN107577579B (en) * 2017-09-15 2020-10-27 通鼎互联信息股份有限公司 Log recording method and device
CN107733709A (en) * 2017-10-17 2018-02-23 北京奇虎科技有限公司 Date storage method, device and electronic equipment
CN107729172A (en) * 2017-10-31 2018-02-23 北京酷我科技有限公司 A kind of method for generating adjustment step by step daily record
CN108415925B (en) * 2018-01-10 2020-11-24 平安科技(深圳)有限公司 Electronic device, data call log generation and query method and storage medium
CN108446370B (en) * 2018-03-15 2019-04-26 苏州思必驰信息科技有限公司 Voice data statistical method and system
CN109766323A (en) * 2018-12-17 2019-05-17 深圳壹账通智能科技有限公司 The full link monitoring method, apparatus of loan transaction, computer equipment and storage medium
CN109525448A (en) * 2019-01-10 2019-03-26 北京智信未来信息技术有限公司 Log data acquisition system and method
CN111694704B (en) * 2019-03-12 2023-10-10 杭州海康威视数字技术股份有限公司 Debug information output method, device, electronic equipment and storage medium
CN110473100B (en) * 2019-08-15 2023-07-11 深圳前海微众银行股份有限公司 Transaction processing method and device based on blockchain system
CN112540808B (en) * 2019-09-23 2023-10-13 腾讯科技(深圳)有限公司 Recording method of program behavior hierarchy call relationship and related equipment
CN112069143A (en) * 2020-08-11 2020-12-11 烽火通信科技股份有限公司 Log level adjusting method, device, equipment and readable storage medium
CN112286791A (en) * 2020-09-27 2021-01-29 长沙市到家悠享网络科技有限公司 Business system testing method, device, equipment and storage medium
CN112631873B (en) * 2020-12-30 2023-11-21 平安证券股份有限公司 Log monitoring method, device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1361489A (en) * 2000-12-28 2002-07-31 深圳市中兴通讯股份有限公司 Automatic circular daily record information storing method and system
CN101183333A (en) * 2007-12-12 2008-05-21 腾讯科技(深圳)有限公司 Method for outputting diary of debugging program, device and system
CN101320348A (en) * 2008-06-25 2008-12-10 中兴通讯股份有限公司 Log function implementing method of embedded system
CN101464908A (en) * 2009-01-14 2009-06-24 北京北方微电子基地设备工艺研究中心有限责任公司 Log recording method and device
CN101753971A (en) * 2008-12-22 2010-06-23 中兴通讯股份有限公司 Journal system and journal recording method in content management system in uniform video management platform

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090198707A1 (en) * 2008-02-06 2009-08-06 Electronic Data Systems Corporation System and method for managing firewall log records
CN100590603C (en) * 2008-08-12 2010-02-17 杭州华三通信技术有限公司 Method and device for processing log file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1361489A (en) * 2000-12-28 2002-07-31 深圳市中兴通讯股份有限公司 Automatic circular daily record information storing method and system
CN101183333A (en) * 2007-12-12 2008-05-21 腾讯科技(深圳)有限公司 Method for outputting diary of debugging program, device and system
CN101320348A (en) * 2008-06-25 2008-12-10 中兴通讯股份有限公司 Log function implementing method of embedded system
CN101753971A (en) * 2008-12-22 2010-06-23 中兴通讯股份有限公司 Journal system and journal recording method in content management system in uniform video management platform
CN101464908A (en) * 2009-01-14 2009-06-24 北京北方微电子基地设备工艺研究中心有限责任公司 Log recording method and device

Also Published As

Publication number Publication date
CN102902764B (en) 2016-05-11
CN105868391A (en) 2016-08-17
CN102902764A (en) 2013-01-30

Similar Documents

Publication Publication Date Title
CN105868391B (en) A kind of method and apparatus of log recording
CN106844217B (en) Method and device for embedding point of applied control and readable storage medium
JP6782778B2 (en) Data processing method and equipment
US8151248B1 (en) Method and system for software defect management
CN107818431B (en) Method and system for providing order track data
US20230129123A1 (en) Monitoring and Management System for Automatically Generating an Issue Prediction for a Trouble Ticket
EP2492815A1 (en) A computer implemented system and method for indexing and optionally annotating use cases and generating test scenarios therefrom
US20080168423A1 (en) Characterizing software components or soa services of a computerized system by context
CN107003931B (en) Decoupling test validation from test execution
Bani-Salameh et al. A deep-learning-based bug priority prediction using RNN-LSTM neural networks
CN103309793A (en) Method and system for ranking analysis tools
WO2017023299A1 (en) Composing future tests
US9405531B2 (en) Methods for building application intelligence into event driven applications through usage learning, and systems supporting such applications
CN112187933A (en) Method and system for monitoring services in multi-architecture cloud platform
CN104123104B (en) Daily record control system and method
CN104199689B (en) The installation method and device of comprehensive front-end system
CN105760283B (en) A kind of log-output method and device
CN112419052B (en) Transaction testing method, device, electronic equipment and readable storage medium
CN114064510A (en) Function testing method and device, electronic equipment and storage medium
CN113934595A (en) Data analysis method and system, storage medium and electronic terminal
CN115098378A (en) Method and device for classifying and aggregating log fragments based on abnormal breakpoints
CN110348984B (en) Automatic credit card data input method and related equipment under different transaction channels
US9098613B2 (en) Logging of application messages
CN111949479A (en) Interactive system and method and equipment for determining index creation condition
US20190243745A1 (en) Debug session analysis for related work item discovery

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220711

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co., Ltd