CN106777049A - A kind of processing method and system for avoiding repeating daily record output - Google Patents

A kind of processing method and system for avoiding repeating daily record output Download PDF

Info

Publication number
CN106777049A
CN106777049A CN201611130080.8A CN201611130080A CN106777049A CN 106777049 A CN106777049 A CN 106777049A CN 201611130080 A CN201611130080 A CN 201611130080A CN 106777049 A CN106777049 A CN 106777049A
Authority
CN
China
Prior art keywords
log
log information
journal file
daily record
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611130080.8A
Other languages
Chinese (zh)
Other versions
CN106777049B (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201611130080.8A priority Critical patent/CN106777049B/en
Publication of CN106777049A publication Critical patent/CN106777049A/en
Application granted granted Critical
Publication of CN106777049B publication Critical patent/CN106777049B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • 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/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1748De-duplication implemented within the file system, e.g. based on file segments

Landscapes

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

Abstract

The invention discloses a kind of processing method and system for avoiding repeating daily record output, the method is comprised the following steps:S1, in diary record system, call the incoming current log information of log write incoming interface function, and be current log information addition parameter unique mark;S2, generate and open new journal file, obtain the log list in diary record system, compare the parameter unique mark of existing log information in current log information and log list, if not existing identical parameter unique mark, to write-in current log information in new journal file;If there is identical parameter unique mark, then it represents that current log information is already present in existing journal file, filtration treatment is carried out to current log information;S3, the new journal file of closing, complete to repeat the treatment of log information.The present invention avoids a large amount of message for repeating from being flooded with whole journal file, it also avoid journal file excessively too fat to move.

Description

A kind of processing method and system for avoiding repeating daily record output
Technical field
The present invention relates to syslog file processing technology field, more particularly to a kind for the treatment of for avoiding repeating daily record output Method and system.
Background technology
Program is published to user on hand, may can also there are some bug, what user was done before can not possibly remembering Operation is difficult description problem, and application developer will repair these bug and be generally difficult to, and daily record can help developer quick The bug of finder.But can sometimes find to take that journal file is very big, there are a large amount of or several for repeating to disappear Breath is flooded with whole journal file, for example, repeat to produce if not a fatal error that will not result in the need for bolt down procedure When raw, substantial amounts of repetition daily record may be just had.
The content of the invention
The technical problem to be solved in the present invention is have a large amount of repetitions for journal file in the prior art, repeats treatment consumption Take the defect of ample resources, there is provided a kind of processing method and system for avoiding repeating daily record output.
The technical solution adopted for the present invention to solve the technical problems is:
The present invention provides a kind of processing method for avoiding repeating daily record output, comprises the following steps:
S1, in diary record system, call the incoming current log information of log write incoming interface function, and be current log Information adds parameter unique mark;
S2, generate and open new journal file, obtain the log list in diary record system, compare current log information With the parameter unique mark of existing log information in log list, if do not exist identical parameter unique mark, to new day Current log information is write in will file;If there is identical parameter unique mark, then it represents that current log information has been present In existing journal file, filtration treatment is carried out to current log information;
S3, the new journal file of closing, complete to repeat the treatment of log information.
Further, the method that current log information carries out filtration treatment is specially in step S2 of the invention:
Judge whether current log information present in log list is expired:
If expired, to write-in current log information in new journal file;
If not out of date, by the existing journal file of current log information updating, the length of current log information is detected, if working as Preceding daily record message length is more than log length setting value, then block current log information from end, its length is met daily record long Degree setting value;If the length of current log information is less than log length setting value, space is added at current log information end, It is set to meet log length setting value.
Further, log write incoming interface function is in step S1 of the invention:
Void log (int level, int code, const char*msg ...)
Wherein, level is logging level, and msg is log information, and code is parameter unique mark, log write incoming interface letter Number end can increase log parameters.
Further, in the method for the present invention, when log function log information msg are called, it is necessary to preserve or Person updates the relevant information of this msg daily records, to provide operation foundation when recording this msg next times;Daily record relevant information passes through Structure stLogMsg and StLogFile are recorded;
StLogMsg structures include:
Daily record mark id, the daily record finally record time nSecLastRecord, the position nSeekPos of the log recording, Log lines nRow, log length nMesLen, the frequency n RecordCnt of the log recording;
StLogFile structures include:
The maximum time interval that the line number nRows of journal file, the state-of-the-art record of a certain daily record are recorded with upper bar NSecExceed, the state-of-the-art record of a certain daily record are spaced nRowExceed with the maximum number of lines that upper bar is recorded.
Further, when generating new journal file in step S2 of the invention, the title of journal file is generated according to the date, And the title of new journal file is added to log list, its method is:
The title of journal file is generated by current date, by it with stLogMsg structures in journal file title Compare, if identical, do not process;If it is different, it is different journal files to represent, then clear up in stLogMsg structures Log list in all log informations for preserving, and new daily record is set to journal file title in stLogMsg structures Filename.
Further, the method that log information is write in step S2 of the invention is specially:Fseek functions are called file The end of journal file is pointed in the position of pointer, using fputs functions toward writing log information in journal file.
Further, in the method for the present invention, whether the expired side of current log information present in log list is judged Method is specially:
If stLogFile::nRows-tLogMsg::nRow>=stLogFile::NRowsExceed, or stLogMsg::nRow-nSecLastRecord>=stLogFile::NRowsExceed, then it represents that current log information correspondence Last log information it is expired.
Further, parameter unique mark of the invention is daily record error code.
The present invention provides a kind of processing system for avoiding repeating daily record output, including:
Log write incoming interface function calling cell, in diary record system, calling log write incoming interface function to pass Enter current log information, and for current log information adds parameter unique mark;
Log information filter element, for generating and opens new journal file, obtains the daily record row in diary record system Table, compares the parameter unique mark of existing log information in current log information and log list, if in the absence of identical ginseng Number unique mark, then to write-in current log information in new journal file;If there is identical parameter unique mark, then it represents that when Preceding log information is already present in existing journal file, and filtration treatment is carried out to current log information;
Daily record output unit, for closing new journal file, completes to repeat the treatment of log information.
The beneficial effect comprise that:The processing method for avoiding repeating daily record output of the invention, by daily record Information adds parameter unique mark, reaches the purpose being identified to log information, can effectively detect and filter out repetition Log information;The method can avoid a large amount of for repeating or several message from being flooded with whole journal file, also avoid Because this original is thus resulted in, journal file is excessively too fat to move, and this serves certain effect for developer's quick positioning question, Substantially increase operating efficiency.
Brief description of the drawings
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Fig. 1 is the flow chart of the embodiment of the present invention;
Fig. 2 is the daily record dependency structure figure of the embodiment of the present invention.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the present invention, not For limiting the present invention.
As shown in figure 1, the processing method for avoiding repeating daily record output of the embodiment of the present invention, comprises the following steps:
S1, in diary record system, call the incoming current log information of log write incoming interface function, and be current log Information adds parameter unique mark;The parameter unique mark of the present embodiment is daily record error code.
Log write incoming interface function is:
Void log (int level, int code, const char*msg ...)
Wherein, level is logging level, and msg is log information, and code is parameter unique mark, log write incoming interface letter Number end can increase log parameters.
, it is necessary to preserve or update the correlation of this msg daily records when log function log information msg are called Information, to provide operation foundation when recording this msg next times;Daily record relevant information by structure stLogMsg and StLogFile is recorded;
StLogMsg structures include:
Daily record mark id, the daily record finally record time nSecLastRecord, the position nSeekPos of the log recording, Log lines nRow, log length nMesLen, the frequency n RecordCnt of the log recording;
StLogFile structures include:
The maximum time interval that the line number nRows of journal file, the state-of-the-art record of a certain daily record are recorded with upper bar NSecExceed, the state-of-the-art record of a certain daily record are spaced nRowExceed with the maximum number of lines that upper bar is recorded.
S2, generate and open new journal file, obtain the log list in diary record system, compare current log information With the parameter unique mark of existing log information in log list, if do not exist identical parameter unique mark, to new day Current log information is write in will file;If there is identical parameter unique mark, then it represents that current log information has been present In existing journal file, filtration treatment is carried out to current log information;The method that filtration treatment is carried out to current log information Specially:
Judge whether current log information present in log list is expired:
If expired, to write-in current log information in new journal file;
If not out of date, by the existing journal file of current log information updating, the length of current log information is detected, if working as Preceding daily record message length is more than log length setting value, then block current log information from end, its length is met daily record long Degree setting value;If the length of current log information is less than log length setting value, space is added at current log information end, It is set to meet log length setting value.
S3, the new journal file of closing, complete to repeat the treatment of log information.
The processing system for avoiding repeating daily record output of the embodiment of the present invention, including:
Log write incoming interface function calling cell, in diary record system, calling log write incoming interface function to pass Enter current log information, and for current log information adds parameter unique mark;
Log Names updating block, for generating new journal file, if the title of new journal file is existing with log list Some journal file titles are differed, then new journal file title is added in log list;
Log information filter element, for generating and opens new journal file, obtains the daily record row in diary record system Table, compares the parameter unique mark of existing log information in current log information and log list, if in the absence of identical ginseng Number unique mark, then to write-in current log information in new journal file;If there is identical parameter unique mark, then it represents that when Preceding log information is already present in existing journal file, and filtration treatment is carried out to current log information;
Daily record output unit, for closing new journal file, completes to repeat the treatment of log information.
In another specific embodiment of the invention, the noun to occurring carries out description below:
●FILE
It is actually the C language structure defined by system to FILE, in the structure containing filename, file status and The information such as file current location.The details of FILE structures need not be concerned about when source program is write.For example:FILE*fp;Representing fp is The pointer variable of FILE structures is pointed to, the structure variable for depositing certain fileinfo can be looked for by fp, then by structure variable The information of offer finds this document, implements the operation to file.Fp is broadly also traditionally called one finger of file of sensing Pin, file pointer points to a file in C language with a pointer variable.
In C language, file operation is all completed by built-in function, the file manipulation function master being related in the present invention There are fread, fwrite, fseek and ftell, fopen functions are used for opening a file,
Fclose functions close a file, and fseek moves the read and write position of file stream, and ftell is used for obtaining file mesh The position of preceding read-write.
● daily record
Daily record is the information of hardware, software and system problem in record system, while can be with generation in monitoring system Event.User can check the reason for mistake occurs, or the vestige that attacker leaves when finding under attack by it.
Relevant interface and function introduction:
●fopen
C language built-in function is somebody's turn to do, for opening file.
Function prototype:FILE*fopen(const char*path,const char*mode);
Parameter:" path " is turned on the filename of file;" mode " refers to that the type of file and operation are required.
Return value:After file smooth opening, the file pointer for pointing to the stream will be returned.If file open failed Return to NULL, and error code is had an errno.
●fclose
C language built-in function is somebody's turn to do, and function is the stream that closes a file.Note:Just can be buffering using fclose () function Last remaining data output is to kernel buffers, and releasing document pointer and relevant buffering area in area.
Function prototype:int fclose(FILE*fp);
Return value:If stream is successfully closed, fclose returns to 0, otherwise returns to EOF (- 1).(if stream is NULL, and Program can be continued executing with, and fclose sets error number to EINVAL, and returns to EOF.)
●fputs
C language built-in function is somebody's turn to do, and the function having is to write a character string to specified file (not automatically write character string End mark symbol ' 0 ').
Function prototype:int fputs(char*string,FILE*fp);
Parameter:String is the character string that will be write;Fp is file flow index.
Return value:After being successfully written a character string, the position indicator pointer of file can be automatically moved back, and function return value is non-negative Integer;Otherwise return to EOF (symbolic constant, its value is -1).
●fseek
C language built-in function is somebody's turn to do, and the function of function is to set the position of file pointer.
Function prototype:int fseek(FILE*fp,long offset,int fromwhere);
Parameter:Parameter fp is the file pointer opened;Parameter offset is to move read-write according to parameter fromwhere The displacement number of position.Parameter fromwhere is following one of which:SEEK_SET、SEEK_CUR、SEEK_END.SEEK_SET Represent that from offset displacements are started away from file be that new read and write position .SEEK_CUR is increased backward with current read and write position Offset displacement .SEEK_END is further added by offset displacement after read and write position is pointed into end-of-file
Return value:0 is then returned to when calling successfully, -1, errno is returned if wrong can deposit error code
●ftell
C language built-in function is somebody's turn to do, and the function is used for obtaining the current read and write position of file stream
Function prototype:long ftell(FILE*fd);
Return value:Current read and write position is then returned to when calling successfully, -1, errno is returned if wrong can be deposited Error code.
General diary record system, can all there is a log write incoming interface function, and the parameter of the function must have day The other specifications such as will content, logging level are optional, and such as void log (int level, const char*msg ...) letter Number parameter includes logging level level and log content.The present invention needs to avoid being repeatedly output in the same daily record short time File, then be accomplished by uniquely confirming this log information, can be unique by the log function newly filling out a parameter Mark daily record, it is also possible to by the cryptographic Hash in the log functions internal calculation msg parameters determining that it is one.Because I opens The log functions that the system of hair is used need incoming daily record error code, so here using the parameter as unique sign of daily record. Log function is void log (int level, int code, const char*msg ...).
, it is necessary to preserve or update the relevant information of this msg daily records when calling log functions to record msg, under Secondary how operation when recording this msg makes a decision.Daily record dependency structure is as shown in Figure 2:
StLogMsg structures record the information of a certain class daily record, and daily record passes through error code unique mark, so here stLogMsg::Id is error code, and the introduction of the more members of the structure can see that it is annotated.
StLogFile is log file structure body, StLogFile::NSecExceed and StLogFile:: NRowsExceed is the expired Rule of judgment of log information, if the last record information of the daily record is expired, it is necessary to current Daily record is processed as new daily record, and new daily record needs to recorded the current end position of file.When this record of certain type daily record Be spaced during with last registration too long or the daily record and journal file newest daily record line number every too remote, referred to as daily record It is expired.stLogMsg::StrFileName is journal file title, when journal file changes, represents this document The stLogMsg of stLogMsg structure objects::All log informations of lstLog need cleaning.
Log recording in the present embodiment is described in detail below and realizes that flow (is called before log function logs, it is necessary to set StLogFile::NSecExceed and StLogFile::The log information outdated conditions such as nRowsExceed, what the system was set StLogFile::NSecExceed is 3, StLogFile::50) nRowsExceed is:
A) parameters such as log functions, incoming logging level, error code, msg contents are called.
B) name (the daily daily record of the system requirement, if the system of journal file is generated by the current date Operation can use new journal file, journal file to be named according to the date across day), with stLogMsg::StrFileName ratios Compared with if different (not processed if identical), expression is different journal files, then clear up stLogMsg::LstLog is preserved All log informations, and to stLogMsg::StrFileName sets new journal file name.
C) fopen functions open journal file, by log function parameter code, in stLogMsg::Searched in lstLog With the presence or absence of this log information.If it does not, performing step d, step e is otherwise performed.
D) call fseek (fd, 0L, SEEK_END) position of file pointer to be pointed to the end of file, use fputs letters Number writes the msg contents toward file, and the line number stLogFile of file::NRows increases by 1, and (attention aims at file at every day In all write as a line).
Due to this msg, write-in journal file is recorded for the first time, so needing in stLogMsg::LstLog is added The log information of stLogMsg structures.
stLogMsg::Id is entered as code,
stLogMsg::NSecLastRecord is obtained by obtaining system time,
stLogMsg::NSeekPos is the file writing position of current log, and new daily record needs to recorded file current End position, the position for obtaining current log write-in needs to call fseek (fd, 0L, SEEK_END), allows the position of file pointer The end of file is pointed to, the current location of file is then obtained by ftell.
tLogMsg::NRow is the row of the file residing for the daily record, is entered as stLogFile::nRows;
tLogMsg::The number of times of the nRecordCnt log recordings, due to first record, is set to 1;
tLogMsg::(attention needs exist for the letter of the number of times plus log recording to the length of the nMsgLen log contents Breath, this is the information that this log system is forced to add after log information, although repeats log information and does not record, but can be by The information of the number of times of log recording recognizes the number of times of the execution of this daily record).
E) because the msg is in stLogMsg::There is log information in lstLog, so will be by the stLogMsg How structure log information determines to this information processing.First have to judge whether this log information is expired.If stLogFile::nRows-tLogMsg::nRow>=stLogFile::NRowsExceed or system time stLogMsg:: nRow-nSecLastRecord>=stLogFile::NRowsExceed, then it represents that current msg last times log information Expired (otherwise not having then expired) using the msg as new daily record, it is necessary to will recorded end-of-file, operation is as step d.
If log information is not expired, it is only necessary to update last daily record by this msg, this is also the present invention Special place.It is as follows that daily record updates step:
Check current msg length (the log length of general identical code mark is identical, it is possible that because It is different that some originals thus result in log length, can see below citing.Write because the write-in of file is covering in addition, if worked as Length of the length of preceding msg more than last time, it is possible to other daily records can be covered),
If the i. length of current msg>stLogMsg::NMsgLen (notes the length of daily record
It is the length after the length information for forcing addition fixed, so the length of msg is also required to plus this length), Blocking the msg from end makes the length of the msg or stLogMsg::NMsgLen (can also locate the daily record as expired Reason),
If ii. current msg length<stLogMsg::NMsgLen, then add empty behind msg
Lattice filling is certainly stLogMsg to msg length::nMsgLen.
For example:There is a first time to have been written into the log for opening camera failure of file, the daily record probably due to shooting Head title it is different and cause the log length can it is different (note the character string behind the daily record ' } ' be force add The information of log recording number of times, the message length is have 8 spaces to be behind fixed 18, times character string colons stLogMsg::NRecordCnt is reserved, i.e., the number of times stLogMsg of the log recording is deposited using the length of 9 characters:: nRecordCnt)
[2016-XX-XX 18:48:06.288][ERROR][0xFFFF0001]{open camera CAMERA10failed.}-times:1
Update log information stLogMsg after this daily record write-in file::NMsgLen be 94 (length of msg be 76+ 18);
If (msg is [2016-XX-XX 18 msg for the type for opening camera failure again at once now: 48:06.688] [ERROR] [0xFFFF0001] { open camera CAMERA100failed. }) daily record is write, because this Msg length 77 is more than stLogMsg certainly plus the length of the message length 18 of log recording number of times::NMsgLen, blocks this After msg, the msg is
[2016-XX-XX 18:48:06.688][ERROR][0xFFFF0001]{open camera CAMERA100failed.
Write file log content be:
[2016-XX-XX 18:48:06.688][ERROR][0xFFFF0001]{open camera CAMERA100failed.-times:2
And (msg is [2016-XX-XX18 a msg for the type for opening camera failure:48:06.688] [ERROR] [0xFFFF0001] { open camera CAMERA1failed. }) to write daily record, it can be seen that and the msg length is 75, behind supplement space, the msg is (having a space behind msg):
[2016-XX-XX 18:48:06.888][ERROR][0xFFFF0001]{open camera CAMERA1failed.}
Write file log content be:
[2016-XX-XX 18:48:06.888][ERROR][0xFFFF0001]{open camera CAMERA1failed.}-times:3
Log recording number of times stLogMsg::NRecordCnt increases by 1, and updates in the information of daily record.So pass through The number of times of Update log, the mode without repeating log, the information such as the bar number of daily record is not lost not only, but also avoid Repeat.
Fseek functions are called, make to allow file pointer moves on to stLogMsg::The position of nSeekPos, calls fputs letters It is several that daily record character string is write file, so far update and terminate.
F) fclose function closing journal files are used.
It can be seen that, using the program, when there is a large amount of same daily records for repeating to export, only can be in recorded mistake before Daily record on the basis of Update log record number information, a large amount of log informations for repeating are not had and appear in journal file In.And due to there is StLogFile::NSecExceed and StLogFile::It is expired that nRowsExceed etc. sets log information Condition, the end position that the repetition day that will not cause to be newly written aims at journal file is too remote.The program avoids a large amount of repetition One or several message be flooded with whole journal file, it also avoid because this original thus result in journal file excessively swelling Swollen, this serves certain effect for developer's quick positioning question.
It should be appreciated that for those of ordinary skills, can according to the above description be improved or converted, And all these modifications and variations should all belong to the protection domain of appended claims of the present invention.

Claims (9)

1. it is a kind of to avoid repeating the processing method that daily record is exported, it is characterised in that to comprise the following steps:
S1, in diary record system, call the incoming current log information of log write incoming interface function, and be current log information Addition parameter unique mark;
S2, generate and open new journal file, obtain the log list in diary record system, compare current log information and day The parameter unique mark of existing log information in will list, if not existing identical parameter unique mark, to new daily record text Current log information is write in part;If there is identical parameter unique mark, then it represents that current log information is already present on existing Have in journal file, filtration treatment is carried out to current log information;
S3, the new journal file of closing, complete to repeat the treatment of log information.
2. it is according to claim 1 to avoid repeating the processing method that daily record is exported, it is characterised in that to current in step S2 The method that log information carries out filtration treatment is specially:
Judge whether current log information present in log list is expired:
If expired, to write-in current log information in new journal file;
If not out of date, by the existing journal file of current log information updating, the length of current log information is detected, if working as the day before yesterday Will message length is more than log length setting value, then block current log information from end, its length is met log length and sets Definite value;If the length of current log information is less than log length setting value, space is added at current log information end, make it Meet log length setting value.
3. it is according to claim 2 to avoid repeating the processing method that daily record is exported, it is characterised in that log write in step S1 Incoming interface function is:
Void log (int level, int code, const char*msg ...)
Wherein, level is logging level, and msg is log information, and code is parameter unique mark, log write incoming interface function end Tail can increase log parameters.
4. the processing method for avoiding repeating daily record output according to claim 3, it is characterised in that when calling log functions It is to record this msg next times, it is necessary to preserve or update the relevant information of this msg daily records when log information msg When provide operation foundation;Daily record relevant information is recorded by structure stLogMsg and StLogFile;
StLogMsg structures include:
Daily record mark id, the daily record finally record time nSecLastRecord, the position nSeekPos of the log recording, the day Aspirations and conduct nRow, log length nMesLen, the frequency n RecordCnt of the log recording;
StLogFile structures include:
Maximum time interval nSecExceed that the line number nRows of journal file, the state-of-the-art record of a certain daily record are recorded with upper bar, The state-of-the-art record of a certain daily record is spaced nRowExceed with the maximum number of lines that upper bar is recorded.
5. it is according to claim 4 to avoid repeating the processing method that daily record is exported, it is characterised in that to be generated in step S2 new During journal file, the title of journal file is generated according to the date, and the title of new journal file is added to log list, its side Method is:
The title of journal file is generated by current date, by it with stLogMsg structures in journal file title ratio Compared with if identical, not processing;If it is different, it is different journal files to represent, then clear up in stLogMsg structures The all log informations preserved in log list, and new daily record text is set to the journal file title in stLogMsg structures Part name.
6. it is according to claim 4 to avoid repeating the processing method that daily record is exported, it is characterised in that to write day in step S2 The method of will information is specially:Call fseek functions the position of file pointer to be pointed to the end of journal file, use fputs Function is toward writing log information in journal file.
7. the processing method for avoiding repeating daily record output according to claim 4, it is characterised in that in judging log list The method whether the current log information of presence is expired is specially:
If stLogFile::nRows-tLogMsg::nRow>=stLogFile::NRowsExceed, or stLogMsg:: nRow-nSecLastRecord>=stLogFile::NRowsExceed, then it represents that current log information corresponding last day Will information is expired.
8. it is according to claim 1 to avoid repeating the processing method that daily record is exported, it is characterised in that the parameter in this method Unique mark is daily record error code.
9. it is a kind of to avoid repeating the processing system that daily record is exported, it is characterised in that including:
Log write incoming interface function calling cell, in diary record system, calling, log write incoming interface function is incoming to work as Preceding log information, and for current log information adds parameter unique mark;
Log information filter element, for generating and opens new journal file, obtains the log list in diary record system, than Compared with the parameter unique mark of existing log information in current log information and log list, if unique in the absence of identical parameter Mark, then to write-in current log information in new journal file;If there is identical parameter unique mark, then it represents that current log Information is already present in existing journal file, and filtration treatment is carried out to current log information;
Daily record output unit, for closing new journal file, completes to repeat the treatment of log information.
CN201611130080.8A 2016-12-09 2016-12-09 Processing method and system for avoiding repeated log output Active CN106777049B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611130080.8A CN106777049B (en) 2016-12-09 2016-12-09 Processing method and system for avoiding repeated log output

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611130080.8A CN106777049B (en) 2016-12-09 2016-12-09 Processing method and system for avoiding repeated log output

Publications (2)

Publication Number Publication Date
CN106777049A true CN106777049A (en) 2017-05-31
CN106777049B CN106777049B (en) 2021-01-01

Family

ID=58875729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611130080.8A Active CN106777049B (en) 2016-12-09 2016-12-09 Processing method and system for avoiding repeated log output

Country Status (1)

Country Link
CN (1) CN106777049B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427619A (en) * 2018-03-13 2018-08-21 腾讯科技(深圳)有限公司 Blog management method, device, computing device and storage medium
CN108563718A (en) * 2018-04-02 2018-09-21 郑州云海信息技术有限公司 A kind of method and system preventing log flood
CN108829543A (en) * 2018-06-21 2018-11-16 郑州云海信息技术有限公司 A method of reducing backup Linux system log size
CN110019064A (en) * 2017-09-01 2019-07-16 大唐移动通信设备有限公司 Eliminate the filter method and device for repeating log recording
CN110515803A (en) * 2019-08-27 2019-11-29 联想(北京)有限公司 For the processing method of log information, device and electronic equipment
CN110908972A (en) * 2019-11-19 2020-03-24 加和(北京)信息科技有限公司 Log data preprocessing method and device, electronic equipment and storage medium
CN111967850A (en) * 2020-08-19 2020-11-20 支付宝(杭州)信息技术有限公司 Data reporting monitoring method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050123121A1 (en) * 2003-11-25 2005-06-09 Alcatel Call failure recording
CN102880718A (en) * 2012-10-12 2013-01-16 互动在线(北京)科技有限公司 Flexible log storage and acquisition method
CN104156420A (en) * 2014-08-06 2014-11-19 曙光信息产业(北京)有限公司 Method and device for managing transaction journal
CN104915460A (en) * 2015-07-10 2015-09-16 上海斐讯数据通信技术有限公司 Log storage method and system
CN105049260A (en) * 2015-08-24 2015-11-11 浪潮(北京)电子信息产业有限公司 Dialog management method and device
CN105955972A (en) * 2016-02-01 2016-09-21 上海华测导航技术股份有限公司 Receiver log management system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050123121A1 (en) * 2003-11-25 2005-06-09 Alcatel Call failure recording
CN102880718A (en) * 2012-10-12 2013-01-16 互动在线(北京)科技有限公司 Flexible log storage and acquisition method
CN104156420A (en) * 2014-08-06 2014-11-19 曙光信息产业(北京)有限公司 Method and device for managing transaction journal
CN104915460A (en) * 2015-07-10 2015-09-16 上海斐讯数据通信技术有限公司 Log storage method and system
CN105049260A (en) * 2015-08-24 2015-11-11 浪潮(北京)电子信息产业有限公司 Dialog management method and device
CN105955972A (en) * 2016-02-01 2016-09-21 上海华测导航技术股份有限公司 Receiver log management system and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HEEJIN PARK ; SANG-CHUL LEE ; SOON-HAENG LEE ; SANG-WOOK KIM: "CentralMatch: A Fast and Accurate Method to Identify Blog-Duplicates", 《2010 IEEE/WIC/ACM INTERNATIONAL CONFERENCE ON WEB INTELLIGENCE AND INTELLIGENT AGENT TECHNOLOGY》 *
李嘉菲等: "一种能发现重复任务的过程挖掘算法", 《吉林大学学报(工学版)》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019064A (en) * 2017-09-01 2019-07-16 大唐移动通信设备有限公司 Eliminate the filter method and device for repeating log recording
CN108427619A (en) * 2018-03-13 2018-08-21 腾讯科技(深圳)有限公司 Blog management method, device, computing device and storage medium
CN108427619B (en) * 2018-03-13 2020-10-20 腾讯科技(深圳)有限公司 Log management method and device, computing equipment and storage medium
CN108563718A (en) * 2018-04-02 2018-09-21 郑州云海信息技术有限公司 A kind of method and system preventing log flood
CN108563718B (en) * 2018-04-02 2021-07-23 郑州云海信息技术有限公司 Method and system for preventing log flood
CN108829543A (en) * 2018-06-21 2018-11-16 郑州云海信息技术有限公司 A method of reducing backup Linux system log size
CN110515803A (en) * 2019-08-27 2019-11-29 联想(北京)有限公司 For the processing method of log information, device and electronic equipment
CN110515803B (en) * 2019-08-27 2021-04-13 联想(北京)有限公司 Processing method and device for log message and electronic equipment
CN110908972A (en) * 2019-11-19 2020-03-24 加和(北京)信息科技有限公司 Log data preprocessing method and device, electronic equipment and storage medium
CN111967850A (en) * 2020-08-19 2020-11-20 支付宝(杭州)信息技术有限公司 Data reporting monitoring method and device and electronic equipment

Also Published As

Publication number Publication date
CN106777049B (en) 2021-01-01

Similar Documents

Publication Publication Date Title
CN106777049A (en) A kind of processing method and system for avoiding repeating daily record output
US9305055B2 (en) Method and apparatus for analysing data packets
CN109656934B (en) Source Oracle database DDL synchronization method and device based on log analysis
CN110147411B (en) Data synchronization method, device, computer equipment and storage medium
Arnaoudova et al. Repent: Analyzing the nature of identifier renamings
Guerrouj et al. Tidier: an identifier splitting approach using speech recognition techniques
Garfinkel et al. A general strategy for differential forensic analysis
CN104899016B (en) Allocating stack Relation acquisition method and device
CN110569214B (en) Index construction method and device for log file and electronic equipment
US10261967B2 (en) Data extraction
JP2000076161A (en) Event log method
CN102402562A (en) Database remote disaster tolerant method and system
CN101727391B (en) Method for extracting operation sequence of software vulnerability characteristics
CN106598785A (en) File system backup and restoration method and device
CN113326165B (en) Data processing method and device based on block chain and computer readable storage medium
CN104301304A (en) Vulnerability detection system based on large ISP interconnection port and method thereof
CN109582504A (en) A kind of data reconstruction method and device for apple equipment
CN110232633A (en) A kind of electronic signature method, apparatus, storage medium and server
Kleppmann et al. Interleaving anomalies in collaborative text editors
CN106815232A (en) Catalog management method, apparatus and system
Zoubek et al. Selective deletion of non-relevant data
Roscoe et al. Checking noninterference in timed CSP
CN109189849A (en) A kind of standardization, the data entry method of procedure and system
CN106649756A (en) Log synchronization method and device
CN111737203A (en) Database history log backtracking method, device, system, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant