CN106156069B - Log system and log recording method - Google Patents
Log system and log recording method Download PDFInfo
- Publication number
- CN106156069B CN106156069B CN201510148436.XA CN201510148436A CN106156069B CN 106156069 B CN106156069 B CN 106156069B CN 201510148436 A CN201510148436 A CN 201510148436A CN 106156069 B CN106156069 B CN 106156069B
- Authority
- CN
- China
- Prior art keywords
- log
- logger module
- module
- logger
- configuration file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The present invention relates to log systems and log recording method.Log system of the invention, including log system interface, logger module, and the mapping table of log category identities and logger module, wherein the logger module is used for the Notification Record log according to log system interface, and the log system interface is according to the mapping table determination of the log category identities and logger module record log module to be notified.
Description
Technical field
The present invention relates to log systems and log recording method.
Background technique
The usual method of server record log is usually: realizing a journaling function, log content can be remembered
It records in specified fixed disk file;If to different log recordings into different fixed disk files, is needed to realize more
A similar journaling function;If it is desired to needing to realize new log again in the storaging mediums such as log recording to database
Record function.
Alternatively, only realizing a journaling function, and increase a parameter in this journaling function, for marking
Log category, then journaling function is according to this parameter, log recording into different fixed disk files.In fact, log
Caching record or immediate record can also be divided, because respectively there are advantage and disadvantage, would generally realize two sets of journaling functions.
Summary of the invention
The present invention provides a kind of log system in one aspect, comprising:
Log system interface,
Logger module, wherein the logger module is used for the Notification Record log according to log system interface,
The mapping table of log category identities and logger module,
Wherein, the log system interface is wanted according to log category identities and the determination of the mapping table of logger module
The record log module of notice.
The present invention provides a kind of log recording method on the other hand, comprising:
It is corresponding with logger module from log category identities according to the log category identities of record log interface notification
Relation table searches logger module ID corresponding with the log category identities,
Will logger module ID Notification Record log interface corresponding with the log category identities,
By the record log interface according to ID pairs of the logger module ID received, notice and the logger module
The logger module answered,
By the logger module, record log.
The present invention provides a kind of log system variation in yet another aspect, the log system include configuration file,
The mapping table of logger module generator, logger module and log category identities and logger module, it is described
Configuration file includes first part and second part, and the first part includes about logger module ID, log recording mould
The type of block and the information of configuration, the second part includes the information about log category identities and logger module ID,
The described method includes:
Logger module generator checks whether the configuration file is changed,
If the configuration file is changed, the judgement of logger module generator is the first part of configuration file
Or second part is changed,
If logger module generator determines that first part is changed, logger module generator is according to
Logger module is modified in the variation of a part,
If logger module generator determines that second part is changed, logger module generator is according to
The mapping table of variation modification the log category identities and logger module of two parts.
The present invention provides a kind of initial method of log system on the other hand, and the log system includes configuration text
Part, logger module generator, the configuration file include first part and second part, the first part include about
The information of logger module ID, the type of logger module and configuration, the second part includes about log kind category
Know the information with logger module ID, which comprises
Logger module generator reads configuration file,
Logger module generator generates logger module according to configuration file first part,
Logger module generator generates log category identities and logger module according to configuration file second
Mapping table,
Wherein if logger module generator determines that there are a log category identities to correspond to according to configuration file
The situation of multiple logger module ID, then logger module generator, which determines, generates composite log logging modle.According to normal
The technology of rule, if it is desired to if the fixed disk file title of modification log storage, it is necessary to modify the source code of server, it is also necessary to weight
It is newly compiled etc., it is more troublesome.Meanwhile if it is desired to be changed to if lane database is recorded certain log by recording disk file,
Also need to modify a large amount of log recording part, because they use different journaling functions.The present invention then draws
Enter logger module, is similar to journaling function in the prior art;Meanwhile invention introduces logger modules
Generator can be configured flexibly in conjunction with the dynamically load of configuration file and configuration file, not need modification source code, also not
It needs to restart server, so that it may realize the modification to log recording mode.
In addition, in case of exception, server (especially game server) short time will record according to conventional technique
When massive logs, leads to hard disk completely and can not record all logs including important log, important log is caused to be lost;And
Server performance is caused to decline to a great extent.Server performance decline usually will cause bad user experience.For example, game server
Performance can seriously affect the game experiencing of participant in game when declining.The present invention only needs to modify configuration file, being abnormal
Log be changed to be recorded by empty logger module, that is, do not record the log being abnormal, then not will lead to important log
It loses, game experiencing will not be influenced.
In addition, according to conventional technique, if it is desired to same log content, while two or more storage matchmakers are recorded
On Jie, then need to modify source code in record log part, it is comparatively laborious.And it is of the invention, it only can need to modify to configure
File simultaneously can be recorded in a log in multiple storaging mediums.
Therefore, technology of the invention may have the advantage that
(1) it can be saved in different storaging mediums with flexible configuration on demand to different types of log content;
(2) it can be saved in a variety of storaging mediums simultaneously same log content;
(3) a certain or a variety of log contents can be recorded with emergent stopping;
(4) flexible configuration is being realized, while saving log content on demand, without the generation for modifying any record log content
Code.
Detailed description of the invention
The present invention may be better understood from the description with reference to the accompanying drawing to a specific embodiment of the invention,
In:
Fig. 1 shows the block diagram of the log system of example embodiment according to the present invention;
Fig. 2 shows the initialization flowcharts of the log system of example embodiment according to the present invention;
Fig. 3 shows the change operation flow chart that example embodiment is executed by logger module generator according to the present invention;
Fig. 4 shows the flow chart that example embodiment according to the present invention carries out logging operations;
Fig. 5 shows the block diagram of computing device according to example embodiment of the present invention.
Specific embodiment
The feature and exemplary embodiment of various aspects of the present invention is described more fully below.Following description covers many
Detail, in order to provide complete understanding of the present invention.It will be apparent, however, to one skilled in the art that
The present invention can be implemented in the case where not needing some details in these details.Below only to the description of embodiment
It is to be provided by showing example of the invention to the clearer understanding of the present invention.The present invention is not limited to set forth below
Any concrete configuration, but cover coherent element under the premise of without departing from the spirit of the present invention or any of component repairs
Change, replace and improves.
Server usually will record log, such as game server record log include important log such as ideal money
Log and virtual item log also include the not too important common user behaviors log of participant in game, for example participant in game uses
Technical ability log etc..Because Log Types are numerous, and having a large amount of logs is that game behavior with participant in game is relevant, institute
It is not abnormal when cannot be guaranteed log recording, and the present invention can flexibly handle such exception.In addition, some servers
Many years may have been runed, with advances in technology with the change of needs, the storaging medium of log may also can change, and
The present invention only needs the logger module for providing respective stored medium and modification configuration that can easily solve the problems, such as, realizes service
The flexible record of device log.
The technical solution proposed according to the present invention can be used for the normal log recording of game server.It can match on demand
Log recording mode is set, such as when starting server, reads configuration file and different days is generated to different log types
Will logging modle.It can be promptly to modify in a manner of log recording, for example server is under attack (can generate a large amount of meanings lesser day
Will content), can be when server break down (such as hard disk failure), on log recording to other storaging mediums, Huo Zhexiu
Change existing logger module, guarantees that high priority log content can be recorded.Technical solution proposed by the invention is not
It limits on a game server, it can also should be on the device of other any required record logs or program.Skill of the invention
Art scheme can be used for program debugging, then can each suspection point in a program if the mistake of more difficult capture occurs in program
It is upper to add a large amount of debugging log, program is then run, until occurring mistake again, then analyzing log can solve to ask
Topic.Because can configure on demand, when not needing these debugging logs, as long as modifying configuration file, so that it may no
These debugging log contents are re-recorded, and do not have to delete previously increased a large amount of debugging logs.It is described in detail with reference to the accompanying drawing
The embodiment of the present invention.
Fig. 1 shows the log system of example embodiment according to the present invention.As shown in Figure 1, example embodiment according to the present invention
Log system include: that configuration file 180, logger module 160, logger module generator 140 and log system connect
Mouth 120.Although being noted that in the embodiment of Fig. 1, configuration file 180 is shown as a part of log system, this field
Technical staff is appreciated that configuration file can be outside log system, as long as logger module generator 140 can be read
Configuration file 180.
Log system interface 120 is used to provide unified interface to the log recording part of server, avoids log recording
Part often change.Example embodiment according to the present invention, the log system interface as unified interface for example may include being used for
Interface, the change interface and initialization interface etc. of record log.
When server wants record log, log system interface 120 can be to 140 Request Log of logger module generator
Logging modle, and according to the return of logger module generator, notify corresponding logger module record log.
Server can periodically call the change interface of log system, periodically to detect whether configuration file changes.If
It changes, logger module generator can read the configuration file changed, modification log category identities and log recording mould
The mapping table and/or logger module of block.
Initialization interface is called when server starts to initialize log system.
Logger module generator 140 includes configuration file analytical unit, and configuration file analytical unit reads and parses
Configuration file 180.According to parsing result, logger module generator 140 generates logger module 160 and log kind category
Know the mapping table with logger module.Logger module generator 140 generates logger module and log incessantly
The mapping table of category identities and logger module is also responsible for safeguarding them.
Meeting after logger module generator 140 receives request of the log system interface 120 to logger module
The mapping table of log category identities and logger module is searched, and according to log category identities, returns to corresponding log
Logging modle is to log system interface 120.
Example embodiment according to the present invention, configuration file 180 for example may include following two-part contents:
1) logger module ID (i.e. logger module title), the type of logger module and configuration;With
2) (a log category identities can correspond to multiple log recordings by log category identities and logger module ID
Module I D).
For ease of description, table 1 provides the example of first part's content of configuration file:
Logger module ID | Type | Configuration |
Hard disk important log | Fixed disk file logger module | money.log |
Database important log | Database journal logging modle | dbtable_money |
Generic log | Fixed disk file logger module | normal.log |
Table 1
1 first row of table is " logger module ID " (i.e. title) field.Logger module ID includes in the example of table 1
" hard disk important log ", " database important log " and " generic log ".It will be understood to those skilled in the art that log recording
Module I D can also for example be indicated by number and/or alphanumeric codes.1 secondary series of table is " type " corresponding with first row (type)
Field, for example, " fixed disk file logger module " and " database journal logging modle ".Third column in table 1 are " configurations "
(Config) field, the store path stored for configuration log logging modle.For example, " fixed disk file log recording mould
Block " needs fixed disk file title, is " money.log " and " normal.log " in this example.Such as database journal record
Module is also required to data table name, is exactly in this example " dbtable_money ".
Table 2 provides the example of the second part of configuration file:
Log category identities | Logger module ID | Logger module ID |
Ideal money log | Hard disk important log | Database important log |
Player's user behaviors log | Generic log |
Table 2
2 first row of table is " log category identities " field, includes two kinds of log type " ideal money days in the example of table 2
Will " and " player's user behaviors log ".It will be understood to those skilled in the art that log category identities for example can also by number and/
Or alphanumeric codes indicate.Other column of table 2 are " logger module ID " fields corresponding with " log category identities ".Although
Two column logger module ID are only gived in table 2, it will be appreciated by those skilled in the art that may include the log of more multiple row
Logging modle ID, that is to say, that each log category identities in the present invention can correspond to one or more logger modules
ID.In the example of table 2, " ideal money log " corresponds to " hard disk important log " and " database important log " two logs
Logging modle ID;Player's user behaviors log corresponds to " generic log " logger module ID.
Logger module generator 140 mainly generates logger module according to first part, and logger module is raw
140 are grown up to be a useful person mainly according to the mapping table of second part generation log category identities and logger module.According to the present invention
An example, the log category identities of generation and the mapping table of logger module are located at logger module generator
In 140.
Logger module 160 is similar to journaling function in the prior art.The type of logger module, example
It such as may include: 1) fixed disk file logger module, for the record log content into specified fixed disk file;2) network day
Will logging modle, for sending log content to log storage server;3) database journal logging modle is used for database
Middle record log content;4) empty logger module, for abandoning log content;And/or 5) composite log logging modle, it uses
In using a variety of record schemes to same log content, such as while to fixed disk file record log content, also Xiang Zhi
Storage server sends log content, or for recording same log content into multiple fixed disk files simultaneously.This field
Technical staff be appreciated that according to specific requirements, can also include other type logger modules.It is according to the present invention to show
Example embodiment, these logger module kind Similar integrals are in same base class.
In record log, server can be passed to log category identities, so that it may according to log category identities, find corresponding
Logger module, then use this logger module record log.If it is, record ideal money log,
Can pass on a skill of craft to others log category identities " ideal money log ", then find this log category identities, corresponded to two log recordings
Module " hard disk important log " and " database important log ".Then the two logger modules are distinguished record log and are arrived
In money.log and dbtable_money.
Fig. 2 is the initialization flowchart of the log system of example embodiment according to the present invention.It (such as is swum in starting server
Play server) when it is necessary to initializing log system.Initialization includes that logger module and generation day are generated according to configuration file
The mapping table of will category identities and logger module.
As shown in Fig. 2, can read configuration file in step 203 logger module generator first.In step 205 log
Logging modle generator can generate logger module according to configuration file, then in step 207 logger module generator
The mapping table of log category identities and logger module can be generated according to configuration file.It should be noted that of the invention
It is not intended to limit the sequence of step 205 and 207, that is to say, that step 205 can carry out before step 207 or step 207
It can be carried out before step 205 or the two can carry out parallel.
If finding a log category identities when generation log category identities and the mapping table of logger module
Corresponding to multiple logger module ID, then logger module generator determination needs to generate composite log logging modle.Example
Such as, in the example of table 2, two places will be recorded in " ideal money log ", then need to configure two logger module ID
(being " hard disk important log " and " database important log " respectively), the two logger modules ID respectively corresponds a record
" fixed disk file logger module " and " a database being recorded in " dbtable_money " in " money.log "
Logger module ".Since in this example, " ideal money log " is related to two logger modules, then need one it is new
Logger module (i.e. " composite log logging modle "), the two logger modules are included.
According to example embodiment of the present invention, logger module generator can also give birth to when generating logger module
At an empty logger module, for log content can be abandoned.
In addition, according to example embodiment of the present invention, server (such as game server) is called at interval of certain time
The change interface of log system, the change interface of log system are notified that logger module generator executes change stream
Journey.Fig. 3 shows the change operation flow chart that example embodiment is executed by logger module generator according to the present invention.
As shown in figure 3, changing process starts in step 301.Text is configured in step 302 logger module generator inspection
Whether part 180 (see Fig. 1) changes, if configuration file does not change, changing process terminates, to avoid consumption server
Energy.
If logger module generator determines that configuration file has variation, then changing process proceeds in step 302
Step 303.In step 303, logger module generator judges whether it is the log in the first part of log configuration file
Logging modle ID, logger module type and/or be configured with variation.If logger module generator determines first
The type of logger module ID, logger module in part and/or configuration change, and changing process proceeds to step
304, logger module generator is according to configuration file maintenance (such as modification) logger module changed.If log
Logging modle generator determines that logger module ID in first part, the type of logger module and configuration do not become
Change, changing process proceeds to step 305.Judge whether it is log configuration file in step 305 logger module generator
Log category identities and/or logger module ID in second part have variation.If logger module generator is true
The log category identities and/or logger module ID determined in second part change, and changing process proceeds to step 306.?
Step 306, logger module generator is according to configuration file maintenance (such as modification) the log category identities changed and day
The mapping table of will logging modle.Changing process terminates in step 307.
According to the present invention, when there is abnormal generation, when needing change log recording mode, configuration file can be modified, for example,
Configuration file can directly be modified by operator.When arriving the change interface of next server calls log system in this way, change
Interface is notified that logger module generator executes changing process as shown in Figure 3, so as to according to newest configuration text
The recording mode of part change log.
For example, if necessary to the not identical text for certain log being also recorded in simultaneously different storaging medium or same storaging medium
When in part (such as in different fixed disk files), configuration file can be modified.First as needed at first of configuration file
Divide the content for increasing logger module ID, the type of logger module and configuration, then modifies the second of configuration file
Portion increases logger module ID corresponding to log category identities.
In addition, according to example embodiment of the present invention, in record log, server can be called in log system interface
Record log interface, and log category identities and log content are transmitted to record log interface.Record log interface is remembered to log
Record request of the module generator transmission to logger module.Logger module generator can execute for example, as shown in figure 4
Then corresponding logger module is returned to record log interface by log recording process.
As described in Figure 4, log recording process starts in step 402.In step 404, logger module generator according to
Log category identities search the mapping table of log category identities and logger module.If do not found in the table
(for example, logger module ID corresponding with log category identities is not present in table, or the log kind is not present in related content
Class mark) step 408 is then gone to, which terminates.If finding log note corresponding with the log category identities in step 404
Module I D is recorded, then log recording process proceeds to step 406, and logger module generator is corresponding by the log category identities
" logger module ID " Notification Record log interface, record log interface lead to according to " the logger module ID " received
Know corresponding logger module, the write operation (such as writing log function by calling) of execution journal.For example, fixed disk file day
Will logging modle log content can be recorded in fixed disk file, and empty logger module can abandon log content.
Some example embodiments according to the present invention, to day in configuration file (or in logger module generator)
Will type is classified.For example, can be in the grade of " configuration " field of configuration file setting log.It can be in abnormal generation
When, corresponding strategy is taken automatically, for example, the log type of low priority is stopped recording, to ensure the important day of high priority
Will energy complete documentation.Operation personnel's monitoring is avoided to cause unnecessary loss not in time.
Some example embodiments according to the present invention can also include abnormal monitoring module in log system.Abnormal monitoring
When module notes abnormalities, configuration file can be modified, the log being abnormal is changed to be recorded by empty logger module, also
It is not record the log being abnormal.In one example, abnormal monitoring module for example may include log flux monitoring system.Such as
Fruit log flux monitoring system finds certain log type, has a large amount of log content to record in a short time, it may be considered that
This log type is abnormal.It can be from log system to operation personnel's alarm or according to the priority of this log type, certainly
The dynamic log content for stopping recording this log type, while continuing to monitor log flow.If log flux monitoring system is sent out
Now restore normal, it can be with the log content of this log type of recovery record.
Other example embodiments according to the present invention, log system can also include storage medium monitoring module.Storage
Medium monitoring module another example is hard drive space monitoring modules.When hard drive space monitoring module discovery hard disk remaining space compared with
It is small, when reaching certain threshold values, it can alarm to operation personnel.When further reaching smaller threshold values, log system can stop
The log type of low priority is recorded, only to ensure the important log energy complete documentation of high priority.
Other example embodiments according to the present invention, log system for example can also include Network Abnormal monitoring module
And/or database abnormal monitoring module, after finding Network Abnormal or database exception, Network Abnormal monitoring module or database
Abnormal monitoring module can alarm or change log recording mode (for example, being changed to log content by modification configuration file
It is recorded in hard disk).
In short, the present invention abstracts logger module, and it is different according to the storaging medium of record log, it may be implemented
Different logger modules.The present invention can also realize the logger module of combining form, the log recording of combining form
Module may include a number of other logger modules, realize that same log content is written to different storaging mediums simultaneously
Effect.The present invention can also realize empty logger module, if using empty logger module, it is meant that work as the day before yesterday
Will content can abandon, can be with when will record a large amount of useless log when server is by certain attack or certain exception occurs
Corresponding log is promptly configured to empty logger module, avoids causing other problems.Invention introduces log recording moulds
Module generator, it can also be safeguarded in logger module, such as a certain log other than logger module can be generated
Appearance is originally to be written to fixed disk file, can be by modifying configuration file, to be revised as to network or database write-in log
Content, or using the logger module of combining form, realize while log content is written to fixed disk file, to network
Or log content is written in database.According to the invention, it is further possible to carry out priority classification to different log types, work as generation
When certain emergency, the log content of high priority is only recorded, and discards the log content of low priority, to ensure Gao You
The log content of first grade can be recorded.According to the present invention, in logger module generator, including a log kind category
Know the correspondence table with logger module.This correspondence table is established when server starts, in configuration file
It is safeguarded when variation, in record log content, for confirming log recording to be used rapidly according to log category identities
Module.According to the present invention, using unified log system interface, in record log content, log category identities need to only be written
And log content, and do not have to pay close attention to how about this log content future records.
It will be appreciated by those skilled in the art that the method for above-described embodiment can be by that can run on the computing device
Computer-readable instruction realize.
Fig. 5 shows the example for being configured to implement the computing device 1002 of one or more embodiments provided herein.Meter
An example for calculating device 1002 is server.Computing device 1002 may include processing unit 1006 and memory 1008.It deposits
Reservoir 1008 for example can be (such as the RAM) of volatibility, non-volatile (such as ROM, flash memory etc.), or both
Combination.This configuration is illustrated on Fig. 5 with dotted line 1004.
Device 1002 may also include additional storage device, including but not limited to, magnetic memory apparatus, light storage device etc.
Deng.Such additional memory devices are illustrated on Fig. 5 with storage device 1010.In one embodiment, implement provided herein
The computer-readable instruction of one or more embodiments can be in storage device 1010.Storage device 1010 can also store behaviour
Make other computer-readable instructions of system, application program etc..Computer-readable instruction can be loaded in memory 1008,
For for example being executed by processing unit 1006.
Device 1002 may also include the communication device 1016 for allowing device 1002 to communicate with other devices.Communication device 1016
It may include but be not limited to, it is modem, network interface card (NIC), integrated network interface, radio frequency sending set/receiver, infrared
Port, USB connection or other interfaces for computing device 1002 to be connected to other computing devices.Communication device 1016 can
Including wired connection or wireless connection.
Device 1002 may include input unit 1014, such as keyboard, mouse, pen, voice input device, touch input dress
It sets, infrared camera, video input device, and/or any other input unit.Such as one or more displays, loudspeaker,
Output device 1012 as printer, and/or any other output device may also be included in that in device 1002.Input dress
Set 1014 and output device 1012 can be connected to device via wired connection, wireless connection or any combination of them
1002。
The component of computing device 1002 can be connected by various interconnection, such as bus.Such interconnection may include
Peripheral Component Interconnect (PCI) as such as PCI Express, universal serial bus (USB), firewire (IEEE 1394),
Light bus structures etc..
The present invention is described by reference to specific embodiments of the present invention above, but those skilled in the art are equal
Solution, can carry out various modifications these specific embodiments, combines and change, without departing from by claim or its equivalent
The spirit and scope of the present invention of restriction.
Claims (21)
1. a kind of log system, comprising:
Log system interface,
Logger module, wherein the logger module is used for the Notification Record log according to log system interface,
The mapping table of log category identities and logger module,
Wherein, the log system interface will be notified according to the mapping table determination of log category identities and logger module
Record log module;
Logger module generator, wherein the logger module and the log category identities and logger module
Mapping table generated by the logger module generator according to configuration file;
Wherein the configuration file includes first part and second part, and the first part includes about logger module
The information of ID, the type of logger module and configuration, the second part includes about log category identities and log recording
The information of module I D.
2. log system as described in claim 1, wherein the logger module include fixed disk file logger module,
Network log logging modle, database journal logging modle, one in empty logger module and composite log logging modle
Kind is a variety of.
3. log system as claimed in claim 2, wherein the logger module of the sky, for abandoning log content.
4. log system as claimed in claim 2, wherein the composite log logging modle is used for same log content
It carries out repeating record.
5. log system as claimed in claim 2, wherein the logger module of these types is inherited in same base class.
6. log system as described in claim 1, wherein the log system interface include for record log interface, become
More interface and/or initialization interface.
7. log system as described in claim 1 further includes logger module generator, wherein the log category identities
It is located in logger module generator with the mapping table of logger module.
8. log system as described in claim 1, wherein the logger module and log category identities and log recording
The mapping table of module is generated when initializing the log system.
9. log system as described in claim 1, wherein the setting logger module that is configured to stores depositing for log
The grade of log is set and/or be arranged to storage space.
10. log system as described in claim 1, wherein when initializing the log system, if logger module
Generator determines that a log category identities correspond to multiple logger module ID, the then log according to the configuration file
Logging modle generator generates composite log logging modle.
11. log system as described in claim 1, wherein the logger module generator is configured as at predetermined intervals
Check whether configuration file changes, if the configuration file changes, the logger module generator is according to changing
The configuration file become modifies the corresponding relationship of the logger module and/or log category identities and logger module
Table.
12. log system as described in claim 1 further includes abnormal monitoring module, the abnormal monitoring module is different in discovery
Chang Shi modifies configuration file.
13. log system as described in claim 1, wherein the configuration file further includes priority tag, for log
Type carries out priority classification, to only record the log content of high priority when specific condition occurs, and discards low excellent
The log content of first grade.
14. log system as described in claim 1 further includes log flux monitoring system, for monitoring in the given time
Whether the log content to be recorded is more than predetermined amount, if the log content to be recorded in the given time is more than predetermined amount,
Confirmation is abnormal.
It, can for monitor storage medium 15. log system as described in claim 1 further includes storage medium monitoring module
Use memory space.
16. a kind of log recording method, comprising:
According to the log category identities of record log interface notification, from the corresponding relationship of log category identities and logger module
Table searches logger module ID corresponding with the log category identities,
Will logger module ID Notification Record log interface corresponding with the log category identities,
By the record log interface according to the logger module ID received, notify corresponding with logger module ID
Logger module,
By the logger module, record log.
17. a kind of log system variation, the log system includes configuration file, logger module generator, log
The mapping table of logging modle and log category identities and logger module, the configuration file include first part and
Two parts, the first part include the information about logger module ID, the type of logger module and configuration, institute
Stating second part includes the information about log category identities and logger module ID, which comprises
Logger module generator checks whether the configuration file is changed,
If the configuration file is changed, logger module generator judgement be configuration file first part or
Second part is changed,
If logger module generator determines that first part is changed, logger module generator is according to first
Logger module is modified in the variation divided,
If logger module generator determines that second part is changed, logger module generator is according to second
The mapping table of the variation modification log category identities and logger module that divide.
18. method as claimed in claim 17, wherein the configuration file is modified when server is abnormal.
19. method as claimed in claim 17, wherein log is being recorded in different storages by the configuration file simultaneously
It is modified when medium or the different location of same storaging medium.
20. a kind of initial method of log system, the log system includes configuration file, logger module generator,
The configuration file includes first part and second part, and the first part includes remembering about logger module ID, log
The type of module and the information of configuration are recorded, the second part includes about log category identities and logger module ID
Information, which comprises
Logger module generator reads configuration file,
Logger module generator generates logger module according to configuration file first part,
Logger module generator is corresponding with logger module according to configuration file second generation log category identities
Relation table,
Wherein if logger module generator determines that there are a log category identities corresponding to multiple according to configuration file
The situation of logger module ID, then logger module generator, which determines, generates composite log logging modle.
21. method as claimed in claim 20,
It includes that logger module generator generates empty log recording that logger module generator, which generates logger module,
Module, for abandoning log content.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510148436.XA CN106156069B (en) | 2015-03-31 | 2015-03-31 | Log system and log recording method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510148436.XA CN106156069B (en) | 2015-03-31 | 2015-03-31 | Log system and log recording method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106156069A CN106156069A (en) | 2016-11-23 |
CN106156069B true CN106156069B (en) | 2019-04-16 |
Family
ID=57337797
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510148436.XA Active CN106156069B (en) | 2015-03-31 | 2015-03-31 | Log system and log recording method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106156069B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108287777A (en) * | 2017-12-27 | 2018-07-17 | 山东浪潮通软信息科技有限公司 | A kind of method and device of record log |
CN109582650B (en) * | 2018-11-09 | 2021-05-25 | 金色熊猫有限公司 | Module calling amount processing method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101571827A (en) * | 2008-04-30 | 2009-11-04 | 国际商业机器公司 | Method for saving logs and log system |
CN101753971A (en) * | 2008-12-22 | 2010-06-23 | 中兴通讯股份有限公司 | Journal system and journal recording method in content management system in uniform video management platform |
CN103793479A (en) * | 2014-01-14 | 2014-05-14 | 上海上讯信息技术股份有限公司 | Log management method and log management system |
CN104375928A (en) * | 2013-08-12 | 2015-02-25 | 鸿富锦精密工业(深圳)有限公司 | Abnormal log management method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1857922A3 (en) * | 2006-05-12 | 2011-02-02 | Kyocera Mita Corporation | System and method for managing trace of issuing certificates |
-
2015
- 2015-03-31 CN CN201510148436.XA patent/CN106156069B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101571827A (en) * | 2008-04-30 | 2009-11-04 | 国际商业机器公司 | Method for saving logs and log system |
CN101753971A (en) * | 2008-12-22 | 2010-06-23 | 中兴通讯股份有限公司 | Journal system and journal recording method in content management system in uniform video management platform |
CN104375928A (en) * | 2013-08-12 | 2015-02-25 | 鸿富锦精密工业(深圳)有限公司 | Abnormal log management method and system |
CN103793479A (en) * | 2014-01-14 | 2014-05-14 | 上海上讯信息技术股份有限公司 | Log management method and log management system |
Also Published As
Publication number | Publication date |
---|---|
CN106156069A (en) | 2016-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101651576B (en) | Alarm information processing method and system | |
US20170279840A1 (en) | Automated event id field analysis on heterogeneous logs | |
CN104246759B (en) | Application programming interfaces testing service | |
JP5984149B2 (en) | Apparatus and method for updating software | |
US10659312B2 (en) | Network anomaly detection | |
CN110502546A (en) | A kind of data processing method and device | |
CN105630847A (en) | Data storage method as well as data query method, apparatus and system | |
CN112860777B (en) | Data processing method, device and equipment | |
US20150248508A1 (en) | Information system construction device, information system construction method, and storage medium | |
CN103257987A (en) | Rule-based distributed log service implementation method | |
CN106549807A (en) | A kind of classification report method of daily record and system | |
JP5268589B2 (en) | Information processing apparatus and information processing apparatus operating method | |
CN109491962A (en) | A kind of file directory tree management method and relevant apparatus | |
CN106156069B (en) | Log system and log recording method | |
JP5773493B2 (en) | Information processing device | |
CN108304142A (en) | A kind of data managing method and device | |
CN104123104B (en) | Daily record control system and method | |
US8392466B2 (en) | Method and apparatus for automated processing of a data stream | |
WO2009050158A2 (en) | Acquisition and expansion of storage area network interoperation relationships | |
US20060294072A1 (en) | Extensible workflows | |
JP2010072876A (en) | Rule creation program, rule creation method, and rule creation device | |
CN114416560A (en) | Program crash analysis aggregation method and system | |
CN110532150B (en) | Case management method and device, storage medium and processor | |
CN108427608A (en) | Event alarm method and event alarm device | |
CN104281534A (en) | Meta data storing method and 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 |