CN105868391A - Method and device for recording log - Google Patents
Method and device for recording log Download PDFInfo
- Publication number
- CN105868391A CN105868391A CN201610237814.6A CN201610237814A CN105868391A CN 105868391 A CN105868391 A CN 105868391A CN 201610237814 A CN201610237814 A CN 201610237814A CN 105868391 A CN105868391 A CN 105868391A
- Authority
- CN
- China
- Prior art keywords
- daily record
- configuration file
- record data
- rank
- log
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1805—Append-only file systems, e.g. using logs or journals to store data
- G06F16/1815—Journaling file systems
Abstract
The invention discloses a method and a device for recording log. The method includes acquiring log data with log levels and characteristic information identifiers; writing the log data with the corresponding log levels into configuration files when the preset configuration files corresponding to the certain log levels are available; organizing the corresponding log data in the configuration files according to the characteristic information identifiers. The method and the device have the advantage that the log positioning and abnormal log reporting efficiency can be improved on the basis that occupancy of log data storage resources is reduced.
Description
The application be filing date JIUYUE in 2012 25 days, Application No. 201210361884.4,
The divisional application of the Chinese invention patent application of entitled " method and apparatus of a kind of log recording ".
Technical field
The present invention relates to file processing technology field, be specifically related to a kind of log recording method and
A kind of device of log recording.
Background technology
The network equipment, system and service routine etc., all can produce one when running and cry daily record (log)
Logout;Every a line daily record all recites the relevant behaviour such as date, time, user and action
The description made.Daily record is to look at system running state and the Main Basis of investigation problem.Daily record is permissible
Be used on line service operation process record and run program monitoring, the day recorded by analysis
Will can be that the mistake occurring and being likely to occur carries out pointing out, alerting, it is also possible to statistical service identifies
Information, improves for service logic and application program updating provides reliable foundation.Such as, certain is soft
In part, there is collapse case in application program, then can find corresponding note from program event daily record
Record, thus help analyze and solve problem.
In prior art, the content of log recording is typically magnanimity, with such as electronic fare payment system
As a example by the log recording of inline system, a payment transaction, often produce a plurality of log recording,
Further, recording, this of the record often intersecting that concurrent many transactions produce
In the case of, person skilled is if it is intended to the fortune of certain or certain several functional modules in inquiry system
Market condition, or relatively low to the efficiency ratio of certain problem made mistakes investigation, and such as, user needs
Which service is inquiry system within a period of time have invoked, and what kind of calling of service be sequentially?System
Which the module that the failure alarms that system is dished out relates to has?These modules are all which kind of the recovery behaviour taked
Make?In the situation that daily record amount is bigger, above-mentioned information to be inquired from the information that system journal is numerous and diverse,
It is clearly a process taken time and effort very much.
Therefore, a technical problem that those skilled in the art urgently solve is presently required is exactly: as
A kind of method what can innovatively propose log recording, in order to reduce daily record data storage resource
On the basis of taking, improve location daily record and the efficiency of report abnormal log.
Summary of the invention
In view of the above problems, it is proposed that the present invention is to provide one to overcome the problems referred to above or at least
The method partly solving a kind of log recording of the problems referred to above, and corresponding a kind of log recording
Device.
According to one aspect of the present invention, it is provided that a kind of method of log recording, including: obtain
Daily record data, described daily record data includes daily record rank and characteristic information mark;When there is certain
During preset configuration file corresponding to daily record rank, other for corresponding journal stage daily record data is write this and joins
Put in file;According to the daily record data that characteristic information mark tissue is corresponding in described configuration file.
According to a further aspect in the invention, it is provided that the device of a kind of log recording, including daily record number
According to acquisition module, journal file detection module, daily record writing module and daily record data tissue mould
Block: described daily record data acquisition module is used for obtaining daily record data, described daily record data includes day
Will rank and characteristic information mark;Described journal file detection module is used for judging whether certain
The preset configuration file that daily record rank is corresponding, the most then call daily record writing module;Described daily record
Writing module is for writing other for corresponding journal stage daily record data in this configuration file;And it is described
Daily record data molded tissue block is for organizing correspondence according to characteristic information mark in described configuration file
Daily record data.
The daily record data meeting daily record level conditions, during log recording, is write by the present invention
In corresponding configuration file, described configuration file can be scanned and initiate different by the process preset
The prompting of Chang Zhi processes, and the most all of daily record data will be organized according to characteristic information mark,
Thus improve location daily record and the efficiency of report abnormal log.
Just for some or certain the several journal stage in all daily record ranks, configuration file be not set
In the case of, the embodiment of the present invention can effectively reduce the memory space shared by journal file.And
By the way of journal file dynamically configures so that the management of daily record is more flexible, thus ensures
Information major part stored in journal file is valuable information, for user's inquiry log
For operation, it is also beneficial to the raising of user operation efficiency.
Described above is only the general introduction of technical solution of the present invention, in order to better understand this
Bright technological means, and can be practiced according to the content of description, and in order to allow the present invention's
Above-mentioned and other objects, features and advantages can become apparent, below especially exemplified by the tool of the present invention
Body embodiment.
Accompanying drawing explanation
By reading the detailed description of hereafter preferred implementation, various other advantage and benefit pair
Will be clear from understanding in those of ordinary skill in the art.Accompanying drawing is only used for illustrating preferred implementation
Purpose, and be not considered as limitation of the present invention.And in whole accompanying drawing, with identical
Reference marks represents identical parts.In the accompanying drawings:
Fig. 1 shows the embodiment of the method 1 of a kind of log recording
Steps flow chart schematic diagram;
Fig. 2 shows the embodiment of the method 2 of a kind of log recording
Steps flow chart schematic diagram;
Fig. 3 shows the device embodiment of a kind of log recording
Structured flowchart.
Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although in accompanying drawing
Show the exemplary embodiment of the disclosure, it being understood, however, that may be realized in various forms this
Disclose and should not limited by embodiments set forth here.On the contrary, it is provided that these embodiments be in order to
The disclosure can be best understood from, and complete for the scope of the present disclosure can be conveyed to ability
The technical staff in territory.
One of core idea of the embodiment of the present invention, during log recording, will meet daily record
In the configuration file of the daily record data write correspondence of level conditions, the process preset can be joined described
Putting file to be scanned and initiate the prompting of abnormal log processing, the most all of daily record data will be by
Organize according to characteristic information mark, thus improve location daily record and the efficiency of report abnormal log.
With reference to Fig. 1, it illustrates the step stream of the embodiment of the method 1 of a kind of log recording of the present invention
Journey schematic diagram, specifically may include steps of:
Step 101, obtains daily record data, and described daily record data includes daily record rank and characteristic information
Mark;
In one preferred embodiment of the invention, described daily record rank can be by people in the art
Member is configured according to practical situation.Such as, all available ranks of configuration log are: INFO,
DEBUG, ERROR, WARN, FATAL;Wherein, INFO refers to the action of all keys
Point and result;Some Debugging message that DEBUG refers to debug whole system and opens,
The when of system stable operation, this information can be closed;ERROR represents that system there occurs that some are wrong
By mistake, the information of mistake is recorded;WARN refers to record when system is close to some resources
Marginal value or occurred in that some resources are not enough or system mistake, is the most also unlikely to shadow
Ring the operation of whole system but need to cause the information of concern;FATAL represent occurred in that the tightest
The problem of weight, needs the information of halt system.Or such as, a kind of semiconductor factory of configuration equipment controls
The all available ranks of system journal are: Verbose (details), Event (event), Problem
(problem), five ranks of Error (mistake), Fatal (fatal error).
As the embodiment of the present invention a kind of example of concrete application in transaction platform, described feature is believed
Breath mark can be the transaction journal number of every transaction in transaction platform.
It is well known that, transaction platform is generally used between consumer, businessman and financial institution using peace
All-electronin means trade goods or service, i.e. (include electronic cash novel means of payment
(E-CASH), the credit card (CREDIT CARD), debit card (DEBIT CARD), intelligence
Card etc.) payment information be sent to bank or corresponding processing mechanism by network security, with realization
Pay by mails.
Feature based on above transaction platform, inventor herein finds the daily record needs of transaction platform
Meet following demand:
1, information covers point needs comprehensively: because transaction platform relates to money, then for safety
Requirement will be the highest, owing to transaction platform can record the flow direction of fund in the way of electronic money
, so, system should carry out record to the operating process of each key position and result, with
Just can support the retrieval to whole process of concluding the business, once certain link there occurs problem, can be very
Clear orientation problem the most quickly, finds unsuccessfully or wrong generation point.
2, log recording needs to simplify as far as possible: the most detailed log recording, can bring bigger reading
The I/O expense of write magnetic dish, so can bring impact to whole transaction platform, cause period of reservation of number
Long, Consumer's Experience is very poor, so daily record is simultaneously need to meet the requirement simplified as far as possible.
3, log recording needs main line: a transaction complete generally to have repeatedly mutual, often
Producing a plurality of log recording, these records are frequently not seriality record, can be existed by interspersed record
Inside journal file, especially under the design supporting high concurrent demand, payment system often uses
Being the framework model of multi-threaded I/O multiplexing, the record that many transactions simultaneously and concurrently produce often is handed over
Folded the recording of staggered floor.
Due to one transaction a plurality of log recording can by interspersed record inside journal file, so
Need unique serial number and identify current transaction.In one preferred embodiment of the invention,
Described characteristic information mark can be the serial number of current transaction, because every transaction needs oneself
In transaction platform, a unique serial number is identified, and adjoint this transaction generation is each
Daily record is also required to a unique characteristic information identification number and is identified, and they have identical
Demand and feature, therefore in embodiments of the present invention, use the transaction journal number of transaction platform as day
Characteristic information mark in will data.Described transaction journal number have it the most regular, example
As, described transaction journal number can be according to the MAC Address of server network interface card, and the time that records is with random
Number generates.Thus ensure that transaction journal number has relative uniqueness, within a period of time, not
Will not repeat on same machine.
In implementing, described daily record data can be in the way of employing records line by line, in the present invention
In embodiment, often row daily record data the most at least includes daily record rank and characteristic information mark.
Step 102, when the preset configuration file that certain daily record rank of existence is corresponding, by corresponding daily record
The daily record data of rank writes in this configuration file.
In one preferred embodiment of the invention, described daily record rank has mark, described preset
Configuration file can according to described daily record level identification the configuration file of filename is set;This
In the case of, described step 102 can include following sub-step:
Whether sub-step S11, check to exist to have under assigned catalogue and comprise corresponding daily record level identification
The configuration file of filename;The most then perform sub-step S12, otherwise perform sub-step S13;
Sub-step S12, by configuration file corresponding for the write of other for corresponding journal stage daily record data;
Sub-step S13, does not write described daily record data in configuration file.
For example, it is assumed that all available ranks of daily record are: INFO, DEBUG, ERROR, WARN,
FATAL, corresponding daily record rank is designated: INFO, DEBUG, ERROR, WARN, FATAL,
Preset configuration file includes ERROR.xxx, WARN.xxx, FATAL.xxx, it is assumed that when previous
Bar daily record data includes daily record rank INFO, checks the configuration file finding do not have respective file name,
Then need not in configuration file, record this daily record data.Assume current another bar daily record data
Include that daily record rank ERROR, retrieval find to exist the configuration file of respective file name
ERROR.xxx, then by this daily record data write this file of ERROR.xxx.
In another preferred embodiment of the invention, described daily record data can also include business
Identification information, described daily record rank has mark, and described preset configuration file can be filename bag
Containing described service identification information and the configuration file of daily record level identification.In this case, described
Step 102 can include following sub-step:
Sub-step S21, check whether exist under assigned catalogue have comprise corresponding service identification information and
The configuration file of the filename of daily record level identification;The most then perform sub-step S22, otherwise perform
Sub-step S23;
Sub-step S22, by configuration file corresponding for the write of other for corresponding journal stage daily record data.
Sub-step S23, does not write described daily record data in configuration file.
For example, it is assumed that all available ranks of daily record include: INFO, DEBUG, ERROR,
WARN, FATAL, corresponding daily record rank is designated: INFO, DEBUG, ERROR,
WARN, FATAL, available service identification information includes: gathering business RecvService, in advance
The configuration file put includes RecvService_WARN_log.xxx,
RecvService_FATAL_log.xxx, it is assumed that when previous bar daily record data includes that service identification is believed
Breath RecvService and daily record rank INFO, check the configuration file finding do not have respective file name,
Then need not in configuration file, record this daily record data.Assume current another bar daily record data
Include that service identification information RecvService and daily record rank WARN, retrieval find to there is correspondence
The configuration file RecvService_WARN_log.xxx of filename, then writes this daily record data
Enter in this file of RecvService_WARN_log.xxx.
It is appreciated that described daily record data the need of in write configuration file is according to above-mentioned example
Can configure.In implementing, employing service identification information can be created under assigned catalogue
With the configuration file that daily record rank is designated filename, i.e. exist under assigned catalogue corresponding service and
The other configuration file of journal stage, then just carry out the record of this daily record data;Otherwise the most not record.
For giving an example: if service identification information is service, it is intended that Log Directory be
, if there is service_INFO_log.xxxx file under this catalogue in/log/service/, then
There is the other daily record data of INFO journal stage and will be written into service_INFO_log.xxxx file
In;If there is service_ERROR_log.xxxx file under this catalogue, then there is error
The other daily record data of journal stage will be written in service_ERROR_log.xxxx file.The most just
It is to say, if there is the configuration file of the same name with certain daily record rank, or, if exist and certain
Individual service identification information and daily record rank configuration file of the same name, it is simply that whether record the day of this rank
The switch of will data, it can be judged each log when, thus realize by system
Dynamic daily record configuration feature.
Certainly, the set-up mode of above-mentioned configuration file is solely for example, in practice, it is also possible to
Use alternate manner that described configuration file is set, such as, create under assigned catalogue and include business mark
Knowledge information, the configuration file of the filename of daily record level identification and record date, in this case,
Then will meet described service identification information, daily record level identification and the logdata record of record date
In corresponding configuration file;Those skilled in the art use according to practical situation and arrange is all feasible
, the present invention to this without being any limitation as.
Just for some or certain the several journal stage in all daily record ranks, configuration file be not set
In the case of, the embodiment of the present invention can effectively reduce the memory space shared by journal file.And
By the way of such a flexible configuration so that the management of daily record is more flexible, thus ensures
Information major part stored in journal file is valuable information, for user's inquiry log
For operation, it is also beneficial to the raising of user operation efficiency.
Above-mentioned configuration file can be used for being scanned by default process, to carry out at abnormal log prompting
Reason.In implementing, an independent process (presetting process) can be set and go scanning described
Configuration file.Described default process can be a daemon, and daemon is that life cycle is long
A kind of process.They usually start when System guides loads, and terminate when system is closed.It is one
Plant the process not controlling terminal at running background.
Daemon can with timing scan configuration file, then according to severity level go to carry out to report to the police with
There is the situation of abnormal log in prompting user.Such as, when scanning error log, send mail
Report to the police;When scanning warning daily record or indicating daily record, send mail and note is reported
Alert.Because daemon is at the configuration file of timing scan daily record, so it will find that failed transactions,
Send alarm, warning information can including, the machine IP, Log Names and the generation that make a mistake are wrong
Transaction odd numbers by mistake.After operation maintenance personnel obtains warning information, this error log can be quickly found,
Because error log is the most less, quickly can find from error log and record this transaction failure
Place, which step generation problem then can position according to log information is.
Certainly, above only the processing mode of described abnormal log is illustrated, this area skill
Art personnel are arbitrarily arranged according to practical situation, the invention is not limited in this regard.
Step 103, according to the daily record number that characteristic information mark tissue is corresponding in described configuration file
According to.
The inventor of this patent is also noted that the recording mode of daily record can affect use to a great extent
The family acquisition to paid close attention to information.The log recording mode that a kind of form is distinct can allow user quickly fixed
Its information paid close attention to of position, rambling record format then can allow user effort a lot of time,
Thus reduce the work efficiency of user.The log recording mode distinct for setting up a kind of form, this
The log recording mode of bright embodiment requires in described configuration file according to characteristic information mark tissue
Corresponding daily record data, by as a example by the application of transaction platform, by transaction journal number tissue correspondence
Many daily record datas of rambling same transaction then can be organized in together by daily record data.
Specifically, the field that can be classified as on the longitudinal axis by transaction journal number, by other data such as day
Will rank, the field that the record time etc. is classified as on transverse axis, user inquires about when, then may be used
To be inquired about by multiple critical fielies such as horizontally and vertically, because having multiple row on transverse axis,
Row analytical tool awk etc. can be used to carry out filter analysis, it is also possible to carry out again after importing data base
Analyze, because the field that daily record data is existing corresponding, such as daily record rank, the record time etc., so
The work importing data base is the simplest.The application embodiment of the present invention so that user can look into
When asking certain context-sensitive characteristic information, can the most quasi-ground locating query, thus enter one
Step improves the efficiency of user's inquiry log.
With reference to Fig. 2, it illustrates the step stream of the embodiment of the method 2 of a kind of log recording of the present invention
Journey schematic diagram, specifically may include steps of:
Step 201, obtains daily record data, and described daily record data is the daily record data recorded line by line, often
Row daily record data specifically includes at least one of following information: progress information, thread information, business
Identification information, characteristic information mark (such as transaction journal number), record the time, daily record rank and
Business operation information.
Such as, the content of a logdata record is:
[10910][1166063936][1************145]20120810 00:00:07.995
INFO@********success!
Wherein, [10910] are process number (progress information), and [1166063936] are thread number (thread
Information), described process number and thread number have recorded some information when system is run respectively, specifically may be used
Obtain with the api interface provided by system.[1************145] is characteristic information mark,
Such as the transaction journal number in transaction platform, 20120810 00:00:07.995 are the record time, specifically may be used
To use timestamp to carry out record, the precision of timestamp can reach Millisecond, in the situation that height is concurrent
Under, timestamp can be used to more clearly distinguish each daily record data.INFO represents daily record rank,
********success!The practical operation information of the business that is carried out of record, including concrete the one of system
What individual process (thread) done on earth at this time point, and whether this thing done becomes
The contents such as merit.
Step 202, when the preset configuration file that certain daily record rank of existence is corresponding, by corresponding daily record
The daily record data of rank writes in this configuration file;
Step 203, according to the daily record number that characteristic information mark tissue is corresponding in described configuration file
According to;
Step 204, by the described daily record data according to characteristic information mark tissue, according to described record
Time is ranked up.
Wherein, above-mentioned configuration file can be used for being scanned by default process, to carry out abnormal log
Prompting processes.
For making those skilled in the art be more fully understood that the present invention, enter below by way of a concrete example
Row explanation.
Such as, user have submitted one at transaction platform and supplemented application with money on August 30th, 2012, and first
Step, the front end system of described transaction platform first judge the request that this user submits to belong to which business (
In reality, business can include multiple, as collected money, paying the bill, the business such as transaction), it is assumed that adjust here
Be registerReceivable (registration charge slip), system is to carry out sectional lists single cent according to business
Part log data, is currently gathering business, then select the Log Directory of gathering business
RecvService;Second step, obtains current system time, and system can be to record one in one day
Journal file, then system positions current Log Directory [20120829] and writes;3rd step,
System judges daily record rank, and supplementing application with money is a normal daily record, and rank is INFO, then select
RecvService_INFO_log.20120829 file, the most then be not written into this configuration file;4th
Step, system obtains transaction journal 0AA00005EC38B2012082900221487185, obtains
Process ID number, and Thread Id number;5th step, operates information by current business, please as received
Asking, recorded by the original message of request, arrive this, all informations are complete,
RecvService_INFO_log.20120829 file generates log recording as follows:
[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 embodiment of the method, in order to be briefly described, therefore it is all expressed as
A series of combination of actions, but those skilled in the art should know, and the present invention is by being retouched
The restriction of the sequence of movement stated because according to the present invention, some step can use other orders or
Person is carried out simultaneously.Secondly, those skilled in the art also should know, reality described in this description
Executing example and belong to preferred embodiment, involved action and module not necessarily present invention institute is necessary
's.
With reference to Fig. 3, it is shown that the device of a kind of log recording is implemented
The structured flowchart of example, specifically can include with lower module:
Daily record data acquisition module 301, is used for obtaining daily record data, and described daily record data includes day
Will rank and characteristic information mark;
Journal file detection module 302, for judging whether corresponding preset of certain daily record rank
Configuration file, the most then call daily record writing module 303;
Daily record writing module 303, for writing this configuration file by other for corresponding journal stage daily record data
In;
Daily record data molded tissue block 304, is used in described configuration file according to characteristic information mark group
Knit the daily record data of correspondence.
In one preferred embodiment of the invention, when described daily record data can also include record
Between;Described device can also include such as lower module:
Order module, for by the described daily record data according to characteristic information mark tissue, according to institute
Stating the record time is ranked up.
Wherein, above-mentioned configuration file can be used for being scanned by default process, to carry out abnormal log
Prompting processes.
A kind of example specifically applied as the embodiment of the present invention, described device is for transaction platform
Log recording, described characteristic information mark can be the transaction journal number of every transaction in transaction platform.
In one preferred embodiment of the invention, described daily record rank has mark, described preset
Configuration file can be the configuration file comprising described daily record level identification in filename.
In another preferred embodiment of the invention, described daily record data also includes service identification
Information, described daily record rank has mark, and described preset configuration file can comprise institute for filename
State service identification information and the configuration file of daily record level identification.
In implementing, described daily record data can also include following at least one: process believe
Breath, thread information and business operation information.
For device embodiment, owing to it is with embodiment of the method basic simlarity, so describe
Fairly simple, relevant part sees the part of embodiment of the method and illustrates.
Each embodiment in this specification all uses the mode gone forward one by one to describe, each embodiment emphasis
Illustrate is all the difference with other embodiments, identical similar part between each embodiment
See mutually.
Provided herein algorithm and display not with any certain computer, virtual system or other set
Standby intrinsic relevant.Various general-purpose systems can also be used together with based on teaching in this.According to upper
The description in face, constructs the structure required by this kind of system and is apparent from.Additionally, the present invention is also
It is not for any certain programmed language.It is understood that, it is possible to use various programming languages realize at this
The present disclosure described, and the description above done language-specific is to disclose this
Bright preferred forms.
In description mentioned herein, illustrate a large amount of detail.It is to be appreciated, however, that
Embodiments of the invention can be put into practice in the case of not having these details.In some instances,
It is not shown specifically known method, structure and technology, in order to do not obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand in each inventive aspect
One or more, above in the description of the exemplary embodiment of the present invention, each of the present invention
Feature is grouped together in single embodiment, figure or descriptions thereof sometimes.But, and
The method of the disclosure should be construed to reflect an intention that i.e. the present invention for required protection requirement
Than the more feature of feature being expressly recited in each claim.More precisely, it is as follows
As the claims in face are reflected, inventive aspect is less than single enforcement disclosed above
All features of example.Therefore, it then follows claims of detailed description of the invention are thus expressly incorporated in
This detailed description of the invention, the most each claim itself is as the independent embodiment of the present invention.
Those skilled in the art are appreciated that and can enter the module in the equipment in embodiment
Row adaptively changes and they is arranged on the one or more equipment different from this embodiment
In.Module in embodiment or unit or assembly can be combined into a module or unit or assembly,
And multiple submodule or subelement or sub-component can be put them in addition.Except such spy
Levy and/or outside at least some in process or unit excludes each other, any combination can be used
To all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) with
And any method or all processes of equipment or unit are combined disclosed in so.Unless additionally
It is expressly recited, every disclosed in this specification (including adjoint claim, summary and accompanying drawing)
Individual feature can be replaced by the alternative features providing identical, equivalent or similar purpose.
Although additionally, it will be appreciated by those of skill in the art that embodiment bags more described herein
Some feature included by including in other embodiments rather than further feature, but different embodiment
The combination of feature means to be within the scope of the present invention and formed different embodiments.Such as,
In the following claims, embodiment required for protection one of arbitrarily can be with arbitrarily
Compound mode use.
The all parts embodiment of the present invention can realize with hardware, or with at one or more
The software module run on processor realizes, or realizes with combinations thereof.The technology of this area
Personnel should be appreciated that and can use microprocessor or digital signal processor (DSP) in practice
Realize the some or all parts in file protection processing equipment according to embodiments of the present invention
Some or all functions.The present invention is also implemented as performing method as described herein
Part or all equipment or device program (such as, computer program and computer program
Product).The program of such present invention of realization can store on a computer-readable medium, or can
To have the form of one or more signal.Such signal can be downloaded from internet website
Obtain, or provide on carrier signal, or provide with any other form.
The present invention will be described rather than limits the present invention to it should be noted above-described embodiment
Make, and those skilled in the art can design without departing from the scope of the appended claims
Go out alternative embodiment.In the claims, any reference marks structure between bracket should not will be located in
Cause limitations on claims.Word " comprises " not exclude the presence of and does not arranges in the claims
Element or step.Word "a" or "an" before being positioned at element do not exclude the presence of multiple this
The element of sample.The present invention can be by means of including the hardware of some different elements and by means of suitable
When the computer of programming realizes.If in the unit claim listing equipment for drying, these dresses
Several in putting can be specifically to be embodied by same hardware branch.Word first, second,
And third use does not indicates that any order.Can be title by these word explanations.
The embodiment of the invention discloses A1, a kind of method of log recording, including:
Obtaining daily record data, described daily record data includes daily record rank and characteristic information mark;
When the preset configuration file that certain daily record rank of existence is corresponding, by other for corresponding journal stage day
Will data write in this configuration file;And
According to the daily record data that characteristic information mark tissue is corresponding in described configuration file.
A2, method as described in claim A1, also include the record time in described daily record data,
The method of described log recording also includes:
By the described daily record data according to characteristic information mark tissue, carry out according to the described record time
Sequence.
A3, method as described in claim A1 or A2, described method is for the day of transaction platform
Will record, described characteristic information is designated in transaction platform the transaction journal number of every transaction.
A4, method as according to any one of claim A1-A3, described daily record rank has mark
Knowing, described preset configuration file is the configuration file comprising described daily record level identification in filename.
A5, method as according to any one of claim A1-A4, described when there is certain daily record
During preset configuration file corresponding to rank, by corresponding the joining of write of other for corresponding journal stage daily record data
The step put in file farther includes:
Check whether to exist under assigned catalogue that there is joining of the filename that comprises corresponding daily record level identification
Put file;And
The most then by configuration file corresponding for the write of other for corresponding journal stage daily record data.
A6, method as according to any one of claim A1-A5, also wrap in described daily record data
Including service identification information, described daily record rank has mark, and described preset configuration file is filename
Comprise the configuration file of described service identification information daily record level identification.
A7, method as according to any one of claim A1-A6, described when there is certain daily record
During preset configuration file corresponding to rank, by corresponding the joining of write of other for corresponding journal stage daily record data
The step put in file farther includes:
Check whether to exist to have under assigned catalogue and comprise corresponding service identification information and daily record rank mark
The configuration file of the filename known;And
The most then by configuration file corresponding for the write of other for corresponding journal stage daily record data.
A8, method as according to any one of claim A1-A7, also wrap in described daily record data
Include following at least one: progress information, thread information and business operation information.
The embodiment of the invention also discloses B9, the device of a kind of log recording, obtain including daily record data
Delivery block, journal file detection module, daily record writing module and daily record data molded tissue block:
Described daily record data acquisition module is used for obtaining daily record data, and described daily record data includes day
Will rank and characteristic information mark;
Described journal file detection module is for judging whether corresponding preset of certain daily record rank
Configuration file, the most then call daily record writing module;
Described daily record writing module is for writing this configuration file by other for corresponding journal stage daily record data
In;And
Described daily record data molded tissue block is used in described configuration file according to characteristic information mark group
Knit the daily record data of correspondence.
B10, device as described in claim B9, also include the record time in described daily record data,
Described log recording apparatus also includes order module:
Described order module for by described according to characteristic information mark tissue daily record data, according to
The described record time is ranked up.
B11, device as described in claim B9 or B10, the device of described log recording is used for
The log recording of transaction platform, described characteristic information is designated in transaction platform the transaction of every transaction
Serial number.
B12, device as according to any one of claim B9-B11, described daily record rank has
Mark, described preset configuration file is the configuration file comprising described daily record level identification in filename.
B13, device as according to any one of claim B9-B12, wherein:
Described journal file detection module is further used for checking under assigned catalogue whether existing have bag
Containing the configuration file of the filename of corresponding daily record level identification, the most then call described daily record write
Module;And
Described daily record writing module is further used for other for corresponding journal stage daily record data is write file
Name comprises in the described configuration file of described corresponding daily record level identification.
B14, device as according to any one of claim B9-B13, in described daily record data also
Including service identification information, described daily record rank has mark, and described preset configuration file is file
Name comprises described service identification information and the configuration file of daily record level identification.
B15, device as according to any one of claim B9-B14, wherein:
Described journal file detection module is further used for checking under assigned catalogue whether existing have bag
Containing corresponding service identification information and the configuration file of the filename of daily record level identification, the most then adjust
With described daily record writing module;And
Described daily record writing module is further used for other for corresponding journal stage daily record data is write file
Name comprises in the described configuration file of described service identification information and described daily record level identification.
B16, device as according to any one of claim B9-B15, in described daily record data also
Including following at least one: progress information, thread information and business operation information.
Claims (10)
1. a method for log recording, including:
Obtaining daily record data, described daily record data includes daily record rank and characteristic information mark;
When the preset configuration file that certain daily record rank of existence is corresponding, by other for corresponding journal stage day
Will data write in this configuration file;And
According to the daily record data that characteristic information mark tissue is corresponding in described configuration file.
2. the method for claim 1, also includes record time, institute in described daily record data
The method stating log recording also includes:
By the described daily record data according to characteristic information mark tissue, carry out according to the described record time
Sequence.
3. method as claimed in claim 1 or 2, described method is for the daily record note of transaction platform
Record, described characteristic information is designated in transaction platform the transaction journal number of every transaction.
4. the method as according to any one of claim 1-3, described daily record rank has mark,
Described preset configuration file is the configuration file comprising described daily record level identification in filename.
5. the method as according to any one of claim 1-4, described when there is certain daily record rank
During corresponding preset configuration file, by configuration literary composition corresponding for the write of other for corresponding journal stage daily record data
Step in part farther includes:
Check whether to exist under assigned catalogue that there is joining of the filename that comprises corresponding daily record level identification
Put file;And
The most then by configuration file corresponding for the write of other for corresponding journal stage daily record data.
6. the method as according to any one of claim 1-5, also includes industry in described daily record data
Business identification information, described daily record rank has mark, and described preset configuration file is that filename comprises
The configuration file of described service identification information daily record level identification.
7. the method as according to any one of claim 1-6, described when there is certain daily record rank
During corresponding preset configuration file, by configuration literary composition corresponding for the write of other for corresponding journal stage daily record data
Step in part farther includes:
Check whether to exist to have under assigned catalogue and comprise corresponding service identification information and daily record rank mark
The configuration file of the filename known;And
The most then by configuration file corresponding for the write of other for corresponding journal stage daily record data.
8. the method as according to any one of claim 1-7, described daily record data also includes with
Descend at least one: progress information, thread information and business operation information.
9. a device for log recording, including daily record data acquisition module, journal file detection mould
Block, daily record writing module and daily record data molded tissue block:
Described daily record data acquisition module is used for obtaining daily record data, and described daily record data includes day
Will rank and characteristic information mark;
Described journal file detection module is for judging whether corresponding preset of certain daily record rank
Configuration file, the most then call daily record writing module;
Described daily record writing module is for writing this configuration file by other for corresponding journal stage daily record data
In;And
Described daily record data molded tissue block is used in described configuration file according to characteristic information mark group
Knit the daily record data of correspondence.
10. device as claimed in claim 9, also includes the record time in described daily record data,
Described log recording apparatus also includes order module:
Described order module for by described according to characteristic information mark tissue daily record data, according to
The described record time is ranked up.
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 |
---|---|---|---|
CN201610237814.6A CN105868391B (en) | 2012-09-25 | 2012-09-25 | A kind of method and apparatus of log recording |
CN201210361884.4A CN102902764B (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 true CN105868391A (en) | 2016-08-17 |
CN105868391B 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) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108062323A (en) * | 2016-11-08 | 2018-05-22 | 北京国双科技有限公司 | A kind of log read method and device |
CN111694704A (en) * | 2019-03-12 | 2020-09-22 | 杭州海康威视数字技术股份有限公司 | Debugging information output method and device, electronic equipment and storage medium |
CN112286791A (en) * | 2020-09-27 | 2021-01-29 | 长沙市到家悠享网络科技有限公司 | Business system testing method, device, equipment and storage medium |
Families Citing this family (33)
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 |
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 |
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 |
CN112631873B (en) * | 2020-12-30 | 2023-11-21 | 平安证券股份有限公司 | Log monitoring method, device, computer equipment and storage medium |
Citations (5)
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)
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 |
-
2012
- 2012-09-25 CN CN201610237814.6A patent/CN105868391B/en active Active
- 2012-09-25 CN CN201210361884.4A patent/CN102902764B/en not_active Expired - Fee Related
Patent Citations (5)
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 |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108062323A (en) * | 2016-11-08 | 2018-05-22 | 北京国双科技有限公司 | A kind of log read method and device |
CN111694704A (en) * | 2019-03-12 | 2020-09-22 | 杭州海康威视数字技术股份有限公司 | Debugging information output method and device, electronic equipment and storage medium |
CN111694704B (en) * | 2019-03-12 | 2023-10-10 | 杭州海康威视数字技术股份有限公司 | Debug information output method, device, electronic equipment and storage medium |
CN112286791A (en) * | 2020-09-27 | 2021-01-29 | 长沙市到家悠享网络科技有限公司 | Business system testing method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN102902764A (en) | 2013-01-30 |
CN102902764B (en) | 2016-05-11 |
CN105868391B (en) | 2019-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105868391A (en) | Method and device for recording log | |
US10843342B2 (en) | System and method for detecting and fixing robotic process automation failures | |
JP6782778B2 (en) | Data processing method and equipment | |
US20070005740A1 (en) | Change event correlation | |
US20050234787A1 (en) | Enterprise service architecture platform architecture for multi-application computer system | |
US9336830B1 (en) | Techniques for analyzing operations of one or more restaurants | |
US10657530B2 (en) | Automated transactions clearing system and method | |
US20060161463A1 (en) | Method and system for in-process tracking of an operation | |
US7743150B1 (en) | Apparatus and method for web service message correlation | |
US20090019046A1 (en) | Multiple configuration item status value analysis | |
US20160179603A1 (en) | Integrated production support | |
CN104866556A (en) | Database fault handling method and apparatus, and database system | |
US20150088594A1 (en) | Techniques for analyzing restaurant operations | |
CN109522325A (en) | Business impact analysis method, apparatus, electronic equipment and storage medium | |
CN104823406A (en) | Identifying reports to address network issues | |
CN112862119A (en) | Method, device, equipment and medium for improving maintenance efficiency of self-service equipment | |
US20070299849A1 (en) | Logging of application messages | |
CN111640030A (en) | Processing device, equipment and storage medium for insurance claim settlement failure data | |
CN100435114C (en) | Online method for checking out software based on interceptor | |
Vuorinen | Monitoring Integration Systems and Visualization | |
Sjögård | Designing an automated ICT monitoring system | |
CN117437069A (en) | Bidirectional account checking method, device, equipment and storage medium | |
WO2020251500A1 (en) | A system for enabling records to be processed automatically | |
CN115309644A (en) | Method and device for testing query page | |
JP5932710B2 (en) | Monitoring device |
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 |