CN110134658A - Log monitoring method, device, computer equipment and storage medium - Google Patents
Log monitoring method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN110134658A CN110134658A CN201910279591.3A CN201910279591A CN110134658A CN 110134658 A CN110134658 A CN 110134658A CN 201910279591 A CN201910279591 A CN 201910279591A CN 110134658 A CN110134658 A CN 110134658A
- Authority
- CN
- China
- Prior art keywords
- log
- daily record
- record data
- printing
- interface
- 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
- 238000000034 method Methods 0.000 title claims abstract description 70
- 238000012544 monitoring process Methods 0.000 title claims abstract description 63
- 238000007639 printing Methods 0.000 claims abstract description 89
- 238000004590 computer program Methods 0.000 claims description 30
- 230000006870 function Effects 0.000 claims description 12
- 238000012806 monitoring device Methods 0.000 claims description 12
- 238000012545 processing Methods 0.000 claims description 10
- 230000010354 integration Effects 0.000 claims description 4
- 238000011835 investigation Methods 0.000 abstract description 5
- 238000011161 development Methods 0.000 abstract description 4
- 230000002085 persistent effect Effects 0.000 abstract description 4
- 230000002159 abnormal effect Effects 0.000 abstract description 3
- 230000008569 process Effects 0.000 description 6
- 238000012795 verification Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000012423 maintenance Methods 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000008030 elimination Effects 0.000 description 2
- 238000003379 elimination reaction Methods 0.000 description 2
- 230000007257 malfunction Effects 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- PEDCQBHIVMGVHV-UHFFFAOYSA-N Glycerine Chemical compound OCC(O)CO PEDCQBHIVMGVHV-UHFFFAOYSA-N 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000000739 chaotic effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 230000002045 lasting effect Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012856 packing Methods 0.000 description 1
- 238000006116 polymerization reaction Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- 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/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1222—Increasing security of the print job
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Computer Security & Cryptography (AREA)
- Debugging And Monitoring (AREA)
Abstract
This application involves abnormal monitoring technical fields, a kind of log monitoring method is provided, device, computer equipment and storage medium, when log recording mark is performed, just corresponding log field is obtained according to log recording mark, log field includes operator's identity information, again by log field according to log mark in journal format integrate, generate daily record data, then the log printing interface of log monitoring jar packet is called to be printed, it recalls log recording interface and records the daily record data printed, realize daily record data persistent storage, so that daily record data is checked without reliance server, it can check whenever and wherever possible and carry out the investigation of problem, and, because the daily record data printed includes operator's identity information, when finding mistake during actual development, it can be quickly fixed by operator's identity information Position problem, and check that the daily record data of printing handles problem in time, improve the efficiency solved the problems, such as.
Description
Technical field
This application involves abnormal monitoring technical fields, more particularly to a kind of log monitoring method, device, computer equipment
And storage medium.
Background technique
In field of computer technology, the network equipment, system and service routine etc. can all generate log number in running
According to every a line log all recites the description of the relevant operations such as date, time and movement.Since journal file would generally be recorded
Some related contents that we operate, therefore daily record data is operator's behavior record, malfunction elimination, monitoring in operation system operation
And the important evidence of discovery error message etc..Staff can be fixed in time by being monitored and analyzing to daily record data
Position problem simultaneously solves the problems, such as.
But currently, monitor about log, staff is to checking that the log of each product systems must remove server
It is inquired, and daily record data can not record operator for the operation of each function, it has not been convenient to problem is checked, so that problem is arranged
It looks into and treatment effeciency is low.
Summary of the invention
Based on this, it is necessary to for the low problem of the protocol questions investigation and treatment effeciency of existing log monitoring, provide one
Kind high-efficient log monitoring method, device, computer equipment and storage medium.
A kind of log monitoring method, comprising:
It is performed when log recording marks, obtains log field corresponding with log recording mark, log field includes
Operator's identity information;
By log field according to log recording mark in journal format integrate, generate daily record data;
Call the log printing interface of default log monitoring jar packet, print log data;
The log recording interface for calling default log monitoring jar packet, records the daily record data printed.
In one of the embodiments, further include:
Classification processing is carried out to daily record data;
The daily record data that selected printing rank is searched in classification treated daily record data, to the printing grade found
Other daily record data is printed.
Call the log printing interface of default log monitoring jar packet in one of the embodiments, print log data it
Before, further includes:
Obtain the log-on message of operator;
When having print right according to the log-on message verification operation person of operator, starting log printing function allows
Print log data.
Recording the daily record data printed in one of the embodiments, includes: the daily record data that prints of record to number
According to library.
After recording the daily record data to database printed in one of the embodiments, further includes:
According to the daily record data backup directory in preset configuration file, the daily record data recorded in database is carried out standby
Part;
Current backup number is counted, when current backup number is greater than maximum backup number, pushes alert message.
In one of the embodiments, according to the daily record data backup directory in preset configuration file, will remember in database
Before the daily record data of record is backed up, further includes:
Define log configuration information and simultaneously generate preset configuration file, log configuration information include daily record data backup directory,
Maximum backup number, daily record data output format and daily record data output destination.
In one of the embodiments, according to the log printing interface address in preset configuration file, default log is called
Before the log printing interface for monitoring jar packet, further includes:
Log Method of printing and log recording method are defined respectively in log printing interface and log recording interface;
By log printing interface and the addition of log recording interface as in initial log monitoring jar packet, default day is generated
Will monitors jar packet.
A kind of log monitoring device, device include:
Data acquisition module obtains log corresponding with log recording mark for being performed when log recording mark
Field, log field include operator's identity information;
Data Integration module, for by log field according to log recording mark in journal format integrate, generate
Daily record data;
Log print module, for calling the log printing interface of default log monitoring jar packet, print log data;
Logger module records the log printed for calling the log recording interface of default log monitoring jar packet
Data.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing
Device performs the steps of when executing the computer program
It is performed when log recording marks, obtains log field corresponding with log recording mark, log field includes
Operator's identity information;
By log field according to log recording mark in journal format integrate, generate daily record data;
Call the log printing interface of default log monitoring jar packet, print log data;
The log recording interface for calling default log monitoring jar packet, records the daily record data printed.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor
It is performed the steps of when row
It is performed when log recording marks, obtains log field corresponding with log recording mark, log field includes
Operator's identity information;
By log field according to log recording mark in journal format integrate, generate daily record data;
Call the log printing interface of default log monitoring jar packet, print log data;
The log recording interface for calling default log monitoring jar packet, records the daily record data printed.
Above-mentioned log monitoring method, device, computer equipment and storage medium are performed, just when log recording marks
Corresponding log field is obtained according to log recording mark, log field includes operator's identity information, then by log word
Section according to log mark in journal format integrated, generate daily record data, then call log monitoring jar packet log beat
Print interface is printed, and is recalled log recording interface and is recorded the daily record data printed, is realizing the printing of daily record data
Meanwhile also realizing daily record data persistent storage, so that checking without reliance server for daily record data, can look into whenever and wherever possible
The investigation of problem is seen and carries out, also, because the daily record data printed includes operator's identity information, in actual development process
, can be by operator's identity information quick positioning question when middle discovery is wrong, and check that the daily record data of printing is handled in time and ask
Topic improves the efficiency solved the problems, such as.
Detailed description of the invention
Fig. 1 is the applied environment figure of log monitoring method in one of the embodiments;
Fig. 2 is the flow diagram of log monitoring method in one of the embodiments;
Fig. 3 is the detailed process schematic diagram of log monitoring method in another embodiment;
Fig. 4 is the structural block diagram of log monitoring device in one of the embodiments;
Fig. 5 is the structural block diagram of log monitoring device in another embodiment;
Fig. 6 is the internal structure chart of computer equipment in one of the embodiments.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not
For limiting the application.
Log monitoring method provided by the present application, can be applied in application environment as shown in Figure 1.Wherein, terminal 102
It is communicated with server 104 by network by network.Firstly, coder (needs record log in log recording point
Method) addition of completing log recording mark so that operator, which logs in product systems by terminal 102, carries out relevant behaviour
Make, operation note can be recorded in daily record data.It is performed when server 104 detects that log recording marks, just
Corresponding with log recording mark log field is obtained, log field includes operator's identity information, when getting log field
Afterwards, just according to log recording mark in journal format log field is integrated, obtain daily record data, then, call pre-
If log monitors the log printing interface print log data of jar packet, the log recording for recalling default log monitoring jar packet is connect
Mouthful, record the daily record data printed.Wherein, terminal 102 can be, but not limited to be various personal computers, laptop,
Smart phone, tablet computer and portable wearable device, server 104 can use the either multiple services of independent server
The server cluster of device composition is realized.
In one of the embodiments, as shown in Fig. 2, providing a kind of log monitoring method, it is applied to Fig. 1 in this way
In server for be illustrated, comprising the following steps:
Step S200 is performed when log recording marks, obtains log field corresponding with log recording mark, log
Field includes operator's identity information.
Log is the logout for the entitled log that the network equipment, system and service routine etc. are generated in running, each
Row log all recites the description of the relevant operations such as date, time, user and movement.In practical applications, coder's meeting
According to demand in log recording point (place for needing record log) addition log recording mark, log recording point be can be set
Before method executes and/or after the method execution and/or place of method execution exception, when being called every time so as to this method, output
Specific operation log, to position and check problem.Wherein, log recording mark can use tangent plane programming technology, also
It is AOP (Aspect Oriented Programming, towards tangent plane programming), specifically, log recording mark can be AOP
It explains, it is that can allow the identifier of procedure identification using one kind of AOP technology that AOP, which is explained,.Log field refers to daily record data
In a member variable, may include operator's identity information, operating time, operation content and operating result.Specifically,
Operator's identity information may include operator's user name, and user name acquisition modes can be based on Spring Security frame
Frame obtains.
Step S400, by log field according to log recording mark in journal format integrate, generate daily record data.
Journal format can be defined as the combination of " operator's user name ", " operating time " and " operation content ", specifically
, journal format can be " ' operator's user name '+' operating time '+' operation content '+' operating result ';Wherein, operator
User name, operating time and operating result are all variable elements, and operating result specifically can be the output of called method
As a result and it is abnormal.For example, the operator as user entitled " Jane " passes through terminal login system, it is desirable to download one from system
When part file X, operator can realize the downloading of file by clicking " downloading " button of this document.When " downloading " button is by point
When hitting, just start the calling of the method for carry out method entitled " download ", at this point, because of the method for method entitled " download "
It is marked added with log recording, when log recording mark is performed, server just obtains day corresponding with log recording mark
Will field, including operator's user name, operating time, operation content and operating result, then by above-mentioned log field Reference Number
The journal format of log recording mark is integrated, and daily record data is generated.Such as daily record data can be that " Jane is in 20XX 3
X, which divides, when X days X of the moon has downloaded file X for X seconds, file download success ".
Step S600 calls the log printing interface of default log monitoring jar packet, print log data.
In the present embodiment, it is to define packing by developer in advance that it is a log monitoring tools that log, which monitors jar packet,
It is introduced into project well, including log printing interface and log recording interface, includes log Method of printing in log printing interface,
Log recording interface includes log recording method, can be used in printing and record log.Jar packet is a large amount of commonly used in polymerization
Java class file, relevant metadata and resource (text and picture etc.) file are flat to develop java to another file
Platform application software or library, meanwhile, jar file is a kind of archive file, with the building of Zip format, using .jar as file extension.Day
Will jar packet can be used the included jar order creation of jdk or extract and obtains.After daily record data generates, default day is just called
The log printing interface of will monitoring jar packet, wherein log printing interface can possess multiple realization classes, and then call according to day
The interface variables stated in will printing interface call log Method of printing, really in the realization class of calling log printing interface
Log Method of printing, it is each method (the namely structure of log recording point which, which defines and print in the project,
Make function) exception, implementing result (operating result), current time (operating time) and the operator's user name Summer Solstice or the Winter Solstice dished out
Will output ground, in the present embodiment, log output ground can be the console of developing instrument, and server prints daily record data to control
Platform processed.
Step S800 calls the log recording interface of default log monitoring jar packet, records the daily record data printed.
After completing the printing of daily record data, to guarantee that log can be realized persistent storage, continue to call default log
Monitor the log recording interface of jar packet, wherein log recording interface can equally possess multiple realization classes, log recording interface
Calling it is practical be exactly the interface variables stated by log recording interface, the example for going the realization class of calling log recording interface
In log recording method, according to log recording method by the logdata record printed to specified destination, it is lasting to carry out
Change storage.It, can be by checking the daily record data recorded when developer encounters problems in later development and maintenance process
Check mistake.
Above-mentioned log monitoring method, when log recording mark is performed, it is right therewith just to be obtained according to log recording mark
The log field answered, log field include operator's identity information, then by log field according to log mark in journal format
It is integrated, generates daily record data, then called the log printing interface of log monitoring jar packet to be printed, recall log
Record interface records the daily record data that prints, realizes daily record data persistent storage so that daily record data check without according to
Rely server, can check whenever and wherever possible and carry out the investigation of problem, also, because the daily record data printed includes operator
Identity information can be by operator's identity information quick positioning question when finding mistake during actual development, and checks and beat
The daily record data of print handles problem in time, improves the efficiency solved the problems, such as.
As shown in figure 3, in one of the embodiments, further include: step S900 carries out classification processing to daily record data,
The daily record data that selected printing rank is searched in classification treated daily record data, the log to the printing rank found
Data are printed.
Daily record data includes multiple ranks, if printing be easy to cause printing chaotic comprising the daily record data of multiple ranks, if
The very little daily record data of printing rank is not easy to distinguish daily record data again.In the present embodiment, daily record data is divided by log function
For five ranks, convenient for mixed and disorderly daily record data is managed collectively.Specifically, five ranks of daily record data are wrapped respectively
It includes: minimum log rank, notice log rank, warning log rank, error log rank and fatal log rank.It can manage
It solves, the division of the rank of daily record data can be determined voluntarily according to their needs, it is not limited here.When to daily record data
After carrying out classification processing, since the total amount of the daily record data of project operation generation may be very big, in general, system
Relevant staff can select important printing rank and print.When staff selectes the printing rank of daily record data
Afterwards, server searches the daily record data of selected printing rank, prints to the daily record data of the printing rank found.Its
In, same daily record data can be located in multiple printing ranks simultaneously, such as minimum log rank may include all log numbers
According to, and the other daily record data of fatal journal stage is also included in the other daily record data of minimum journal stage naturally.For example, working as work people
The selected log rank of member is minimum log rank, and server can be by the daily record data of minimum log rank and above rank whole
It prints, including fatal log rank, if selected log rank is warning log rank, server can will alert journal stage
Not, error log rank and the other daily record data of fatal journal stage all print, and staff can be from the log number of printing
Auxiliary positioning is carried out to the mistake of appearance in, navigates to the error point of code.In the present embodiment, by log function to log
Data carry out classification processing, print to the daily record data of the selected printing rank found, can be from lengthy and jumbled log
Important daily record data may be positioned to error of item and Maintenance Significant Items system performance is found out in data, is item
Mesh occurs to provide succinct reliable positioning means when mistake.
Call the log printing interface of default log monitoring jar packet in one of the embodiments, print log data it
Before, further includes: step S500 obtains the log-on message of operator, has when according to the log-on message verification operation person of operator
When print right, starting log printing function allows print log data.
Under normal circumstances, after developer completes the logical architecture of print log data, when log mark one is run
Daily record data will be printed, in the present embodiment, before log system prints daily record data, it is also necessary to verification operation
The log-on message of person.I.e. when operator is under the state that is not logged in, it is desirable to which, when system carries out corresponding operating, server can be to operation
The terminal that person logs in sends log-in instruction, and terminal receives and opens a login interface after log-in instruction, and operator can be according to stepping on
The prompt information recorded on interface inputs corresponding log-on message, and server judges operator according to the log-on message that operator inputs
Whether print right is had.Specifically, the log-on message includes but is not limited to login password, operator's user name, operator
The permission of ID card No. and/or operator's login name and operator.When server authentication operation person has print right,
Just starting log printing function is to carry out log printing;When server authentication operation person does not have print right, just
Closing journal printing function, so that daily record data can not be printed.Identity is carried out to operator before print log data to test
Card, can be avoided the operation of those without authority, so that it is guaranteed that the safety of project operation.
Recording the daily record data printed in one of the embodiments, includes: the daily record data that prints of record to number
According to library.
The output destination of daily record data is configured in the configuration file of daily record data comprising print destination and note
Record destination.In the present embodiment, print destination is console, and record destination is database.When server has printed log
After data, record destination is obtained, according to log recording method by the logdata record printed to database.It can manage
Solution, record destination are not limited to database, and in other embodiments, record destination can also be specified file
Folder, local disk either cloud network platform.By the logdata record printed into database so that developer without
The starting of reliance server is needed, can check daily record data at any time, improves investigation efficiency, is conducive to the maintenance in later period.
As shown in figure 3, after recording the daily record data to database printed in one of the embodiments, further includes:
Step S950 backs up the daily record data recorded in database according to the daily record data backup directory in configuration file;System
Current backup number is counted, when current backup number is greater than maximum backup number, pushes alert message.
Configuration file is exactly all to be brought together log configuration information in programming process, so that project has well
Expansibility file, project scheduling and maintenance can be played the role of.Such as JDBC (Java DataBase
The connection of Connectivity, java database), database connection string can be write XML (Extensible Markup
Language, extensible markup language) configuration file if to modify data source only need to change XML configuration file, nothing
Java file need to be recompilated.In the present embodiment, all it is defined in preset configuration file about log configuration information, preset configuration
File is good by developer's predefined, and in lead-in item, preset configuration file may include that software operation needs ginseng to be used
Several and operator's preference etc., specifically comprising the log configuration information for the log system that software operation needs, further
, it may include backup directory, output format and output destination of log system daily record data etc., can also include day
The interface IP address of will printing interface and log recording interface.Daily record data is stored in database profession, if significant trouble occurs, number
There is risk of missing according to the daily record data in library, be not easy to backstage developer and tester and malfunction elimination is carried out to system,
Therefore it needs to back up daily record data.In the present embodiment, backed up in the daily record data of the configured good daily record data of configuration file
Catalogue, maximum backup number, server back up daily record data in database according to daily record data backup directory, and in real time
Backup number is counted, when the backup number of daily record data is greater than default maximum backup number, push alert message to client,
Alert message is for notifying staff to delete unnecessary daily record data in time.It is understood that daily record data backup mesh
Record, maximum backup number can be set according to the actual situation, it is not limited here.Pass through the push of alert message, energy
Daily record data is enough reduced to the occupancy of memory space, saves storage resource.
In one of the embodiments, according to the daily record data backup directory in preset configuration file, will remember in database
Before the daily record data of record is backed up, further includes: it defines log configuration information and generates preset configuration file, log configuration
Information includes daily record data backup directory, maximum backup number, daily record data output format and daily record data output destination.
In practical applications, the output of daily record data needs the good configuration file of predefined, and then to the defeated of daily record data
Flexible setting is carried out out.In the present embodiment, developer adds initial configuration file in advance under project root, and first at this
Log configuration information is defined in beginning configuration file, generates preset configuration file.Wherein, log configuration information includes that daily record data is defeated
Format, daily record data output destination, daily record data backup directory and maximum backup number etc. out.Specifically, log exports
Format is the content of log output, the content of general each log output should include current date, the time, code position,
The information such as log rank, daily record data and error code, output destination are the address of log output, daily record data backup mesh
Record is the backup path of daily record data, and maximum backup number is the maximum upper limit of daily record data backup number.It is understood that
It is that daily record data log configuration information in configuration file is customized log configuration information, is not limited to the present embodiment
The information such as the log output format enumerated and output destination, can be defined, and daily record data according to the actual situation
Output format, output destination, daily record data backup directory, maximum backup number are all variable element, can be according to the actual situation
It is configured.In the present embodiment, pass through the output format, output destination, daily record data of the customized daily record data of configuration file
Backup directory, maximum backup number etc., realize and concentrate management to daily record data.When developer needs to modify log output purpose
It when ground, is changed line by line without going in item code, need to only change the output destination of the daily record data in configuration file, subtract
Lack the operation of redundancy, simplifies amendment step.
Call the log printing interface of default log monitoring jar packet in one of the embodiments, print log data it
Before, further includes: log Method of printing and log recording method are defined respectively in log printing interface and log recording interface
In, by log printing interface and the addition of log recording interface as in initial log monitoring jar packet, generate default log monitoring
Jar packet.
Since interface must be implemented, therefore log Method of printing and log recording method are defined in by developer respectively
After log printing interface and log recording interface, the realization class of log printing interface and log recording interface can be write,
The realization class has implemented all methods stated in log printing interface and log recording interface, including log printing
Method and log recording method.In this way, what is actually called is the reality of the realization class of interface when called side calling interface
Example does not need to know and realizes that the concrete kind of interface is, only need to call the interface for interface called side,
To increase the reusability of code.
It should be understood that although each step in the flow chart of Fig. 2-3 is successively shown according to the instruction of arrow,
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-3
Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps
Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively
It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately
It executes.
In one of the embodiments, as shown in figure 4, providing a kind of log monitoring device, comprising: data acquisition module
410, Data Integration module 420, log print module 430 and logger module 440, in which:
Data acquisition module 420 obtains day corresponding with log recording mark for being performed when log recording mark
Will field, log field include operator's identity information.
Data Integration module, for by log field according to log recording mark in journal format integrate, generate
Daily record data.
Log print module 430, for calling the log printing interface of default log monitoring jar packet, print log data.
Logger module 440 is recorded and is printed for calling the log recording interface of default log monitoring jar packet
Daily record data.
As shown in figure 5, in one of the embodiments, log monitoring device further include classification processing module 450, for pair
Daily record data carries out classification processing, and the daily record data of selected printing rank is searched in classification treated daily record data, right
The daily record data of the printing rank found is printed.
As shown in figure 5, log monitoring device further includes authentication module 460 in one of the embodiments, for obtaining behaviour
The log-on message of author, when having print right according to the log-on message verification operation person of operator, starting log prints function
Can, allow print log data.
Logger module 440 is also used to record the daily record data that prints to database in one of the embodiments,.
Log monitoring device further includes backup module 470 in one of the embodiments, for according in configuration file
Daily record data backup directory backs up the daily record data recorded in database, counts current backup number, works as current backup
When number is greater than maximum backup number, alert message is pushed.
As shown in figure 5, log monitoring device further includes data configuration module 480 in one of the embodiments, for fixed
Adopted log configuration information simultaneously generates preset configuration file, and log configuration information includes daily record data backup directory, maximum backup number
Mesh, daily record data output format and daily record data output destination.
As shown in figure 5, log monitoring device further includes monitoring jar packet handing module 490 in one of the embodiments,
For defining log Method of printing and log recording method respectively in log printing interface and log recording interface, by day
Will printing interface and the addition of log recording interface generate default log and monitor jar packet as in initial log monitoring jar packet.
Specific about log monitoring device limits the restriction that may refer to above for log monitoring method, herein not
It repeats again.Modules in above-mentioned log monitoring device can be realized fully or partially through software, hardware and combinations thereof.On
Stating each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also store in a software form
In memory in computer equipment, the corresponding operation of the above modules is executed in order to which processor calls.
A kind of computer equipment is provided in one of the embodiments, which can be server, in
Portion's structure chart can be as shown in Figure 6.The computer equipment includes that the processor, memory, network connected by system bus connects
Mouth and database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The storage of the computer equipment
Device includes non-volatile memory medium, built-in storage.The non-volatile memory medium be stored with operating system, computer program and
Database.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.It should
The database of computer equipment is used for storing daily record data.The network interface of the computer equipment is used to pass through with external terminal
Network connection communication.To realize a kind of log monitoring method when the computer program is executed by processor.
It will be understood by those skilled in the art that structure shown in Fig. 5, only part relevant to application scheme is tied
The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment
It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
A kind of computer equipment, including memory and processor are provided in one of the embodiments, are deposited in memory
Computer program is contained, which performs the steps of when executing computer program is performed when log recording marks, and obtains
Log field corresponding with log recording mark is taken, log field includes operator's identity information, by log field according to log
Journal format in record mark is integrated, and daily record data is generated, and the log printing of default log monitoring jar packet is called to connect
Mouthful, print log data call the log recording interface of default log monitoring jar packet, record the daily record data printed.
In one of the embodiments, processor execute computer program when also perform the steps of to daily record data into
Row classification processing is searched the daily record data of selected printing rank in classification treated daily record data, is beaten what is found
The daily record data of print rank is printed.
It is also performed the steps of when processor executes computer program in one of the embodiments, and obtains operator's
Log-on message, when having print right according to the log-on message verification operation person of operator, starting log printing function allows
Print log data.
It also performs the steps of when processor executes computer program in one of the embodiments, according to configuration file
In daily record data backup directory, the daily record data recorded in database is backed up, count current backup number, when current
When backup number is greater than maximum backup number, alert message is pushed.
It is also performed the steps of when processor executes computer program in one of the embodiments, and defines log configuration
Information simultaneously generates preset configuration file, and log configuration information includes daily record data backup directory, maximum backup number, log number
According to output format and daily record data output destination.
It is also performed the steps of when processor executes computer program in one of the embodiments, and defines log respectively
Method of printing and log recording method are in log printing interface and log recording interface, by log printing interface and day
The addition of will record interface generates default log and monitors jar packet as in initial log monitoring jar packet.
Also perform the steps of what record printed when processor executes computer program in one of the embodiments,
Daily record data is to database.
A kind of computer readable storage medium is provided in one of the embodiments, is stored thereon with computer program,
It performs the steps of when computer program is executed by processor and is performed when log recording marks, obtained and log recording mark
Infuse corresponding log field, log field includes operator's identity information, by log field according to log recording mark in day
Will format is integrated, and daily record data is generated, and is called and is preset the log printing interface that log monitors jar packet, print log data,
The log recording interface for calling default log monitoring jar packet, records the daily record data printed.
It also performs the steps of when computer program is executed by processor in one of the embodiments, to daily record data
Classification processing is carried out, the daily record data of selected printing rank is searched in classification treated daily record data, to what is found
The daily record data of printing rank is printed.
It is also performed the steps of when computer program is executed by processor in one of the embodiments, and obtains operator
Log-on message, when according to the log-on message verification operation person of operator have print right when, starting log printing function, permit
Perhaps print log data.
It is also performed the steps of when computer program is executed by processor in one of the embodiments, according to configuration text
Daily record data backup directory in part, the daily record data recorded in database is backed up, and current backup number is counted, when working as
When preceding backup number is greater than maximum backup number, alert message is pushed.
Definition log is also performed the steps of when computer program is executed by processor in one of the embodiments, to match
Confidence ceases and generates preset configuration file, and log configuration information includes daily record data backup directory, maximum backup number, log
Data output format and daily record data output destination.
It is also performed the steps of when computer program is executed by processor in one of the embodiments, and defines day respectively
Will Method of printing and log recording method in log printing interface and log recording interface, by log printing interface and
The addition of log recording interface generates default log and monitors jar packet as in initial log monitoring jar packet.
Record is also performed the steps of when computer program is executed by processor in one of the embodiments, to print
Daily record data to database.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the computer program can be stored in non-volatile computer can
It reads in storage medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, originally
Any reference used in each embodiment provided by applying to memory, storage, database or other media, can wrap
Include non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM
(PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include
Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms,
Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing
Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.
Claims (10)
1. a kind of log monitoring method, which is characterized in that the described method includes:
It is performed when log recording marks, obtains log field corresponding with log recording mark, the log field
Including operator's identity information;
The log field is integrated according to the journal format in log recording mark, generates daily record data;
The log printing interface for calling default log monitoring jar packet, prints the daily record data;
The log recording interface for calling the default log monitoring jar packet, records the daily record data printed.
2. log monitoring method according to claim 1, which is characterized in that further include:
Classification processing is carried out to the daily record data;
The daily record data that selected printing rank is searched in classification treated daily record data, to the printing rank found
Daily record data is printed.
3. log monitoring method according to claim 1, which is characterized in that described that default log is called to monitor jar packet
Log printing interface, before printing the daily record data, further includes:
Obtain the log-on message of operator;
When verifying the operator according to the log-on message of the operator has print right, starting log printing function,
Allow to print the daily record data.
4. log monitoring method according to claim 1, which is characterized in that described to record the daily record data packet printed
It includes: recording the daily record data that prints to database.
5. log monitoring method according to claim 4, which is characterized in that the daily record data that the record prints to number
After library, further includes:
According to the daily record data backup directory in preset configuration file, the daily record data recorded in the database is carried out standby
Part;
Current backup number is counted, when the current backup number is greater than the maximum backup number, pushes alert message.
6. log monitoring method according to claim 5, which is characterized in that the log according in preset configuration file
Data backup catalogue, before the daily record data recorded in the database is backed up, further includes:
It defines log configuration information and generates the preset configuration file, the log configuration information includes daily record data backup
Catalogue, maximum backup number, daily record data output format and daily record data output destination.
7. log monitoring method according to any one of claims 1 to 6, which is characterized in that described according to preset configuration text
Log printing interface address in part, before calling default log to monitor the log printing interface of jar packet, further includes:
Log Method of printing and log recording method are defined respectively in log printing interface and log recording interface;
By the log printing interface and log recording interface addition as in initial log monitoring jar packet, generate pre-
If log monitors jar packet.
8. a kind of log monitoring device, which is characterized in that described device includes:
Data acquisition module obtains log corresponding with log recording mark for being performed when log recording mark
Field, the log field include operator's identity information;
Data Integration module, for the log field to be integrated according to the journal format in log recording mark,
Generate daily record data;
Log print module prints the daily record data for calling the log printing interface of default log monitoring jar packet;
Logger module, for calling the log recording interface of the default log monitoring jar packet, record print it is described
Daily record data.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists
In the step of processor realizes any one of claims 1 to 7 the method when executing the computer program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
The step of method described in any one of claims 1 to 7 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910279591.3A CN110134658B (en) | 2019-04-09 | 2019-04-09 | Log monitoring method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910279591.3A CN110134658B (en) | 2019-04-09 | 2019-04-09 | Log monitoring method, device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110134658A true CN110134658A (en) | 2019-08-16 |
CN110134658B CN110134658B (en) | 2024-05-03 |
Family
ID=67569402
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910279591.3A Active CN110134658B (en) | 2019-04-09 | 2019-04-09 | Log monitoring method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110134658B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110780857A (en) * | 2019-10-23 | 2020-02-11 | 杭州涂鸦信息技术有限公司 | Unified log component |
CN111045616A (en) * | 2019-12-24 | 2020-04-21 | 深圳乐信软件技术有限公司 | Time-consuming printing method, time-consuming printing device, time-consuming printing equipment and storage medium |
CN111125043A (en) * | 2019-11-21 | 2020-05-08 | 深圳前海环融联易信息科技服务有限公司 | Intelligent log output method and device, computer equipment and storage medium |
CN111143185A (en) * | 2019-12-30 | 2020-05-12 | 珠海金山网络游戏科技有限公司 | Log-based fault analysis method and device |
CN112346949A (en) * | 2020-11-30 | 2021-02-09 | 杭州安恒信息技术股份有限公司 | AOP-based operation log recording method and system, electronic device and medium |
CN112434335A (en) * | 2020-11-25 | 2021-03-02 | 平安普惠企业管理有限公司 | Business problem processing method and device, computer equipment and storage medium |
CN112579553A (en) * | 2020-12-15 | 2021-03-30 | 京东数字科技控股股份有限公司 | Method and apparatus for recording information |
CN113360469A (en) * | 2021-06-25 | 2021-09-07 | 武汉众邦银行股份有限公司 | Structured low-storage log output method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105871574A (en) * | 2015-01-21 | 2016-08-17 | 中国移动通信集团浙江有限公司 | Method, device and system for monitoring log based on software development kit |
CN106850295A (en) * | 2017-02-04 | 2017-06-13 | 郑州云海信息技术有限公司 | A kind of log collection monitoring method of privatization cloud platform |
CN108287777A (en) * | 2017-12-27 | 2018-07-17 | 山东浪潮通软信息科技有限公司 | A kind of method and device of record log |
CN109460343A (en) * | 2018-09-10 | 2019-03-12 | 平安科技(深圳)有限公司 | System exception monitoring method, device, equipment and storage medium based on log |
CN109492073A (en) * | 2018-10-31 | 2019-03-19 | 北京达佳互联信息技术有限公司 | Blog search method, blog search device and computer readable storage medium |
-
2019
- 2019-04-09 CN CN201910279591.3A patent/CN110134658B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105871574A (en) * | 2015-01-21 | 2016-08-17 | 中国移动通信集团浙江有限公司 | Method, device and system for monitoring log based on software development kit |
CN106850295A (en) * | 2017-02-04 | 2017-06-13 | 郑州云海信息技术有限公司 | A kind of log collection monitoring method of privatization cloud platform |
CN108287777A (en) * | 2017-12-27 | 2018-07-17 | 山东浪潮通软信息科技有限公司 | A kind of method and device of record log |
CN109460343A (en) * | 2018-09-10 | 2019-03-12 | 平安科技(深圳)有限公司 | System exception monitoring method, device, equipment and storage medium based on log |
CN109492073A (en) * | 2018-10-31 | 2019-03-19 | 北京达佳互联信息技术有限公司 | Blog search method, blog search device and computer readable storage medium |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110780857A (en) * | 2019-10-23 | 2020-02-11 | 杭州涂鸦信息技术有限公司 | Unified log component |
CN110780857B (en) * | 2019-10-23 | 2024-01-30 | 杭州涂鸦信息技术有限公司 | Unified log component |
CN111125043A (en) * | 2019-11-21 | 2020-05-08 | 深圳前海环融联易信息科技服务有限公司 | Intelligent log output method and device, computer equipment and storage medium |
CN111125043B (en) * | 2019-11-21 | 2023-05-05 | 深圳前海环融联易信息科技服务有限公司 | Intelligent log output method and device, computer equipment and storage medium |
CN111045616A (en) * | 2019-12-24 | 2020-04-21 | 深圳乐信软件技术有限公司 | Time-consuming printing method, time-consuming printing device, time-consuming printing equipment and storage medium |
CN111143185A (en) * | 2019-12-30 | 2020-05-12 | 珠海金山网络游戏科技有限公司 | Log-based fault analysis method and device |
CN112434335A (en) * | 2020-11-25 | 2021-03-02 | 平安普惠企业管理有限公司 | Business problem processing method and device, computer equipment and storage medium |
CN112346949A (en) * | 2020-11-30 | 2021-02-09 | 杭州安恒信息技术股份有限公司 | AOP-based operation log recording method and system, electronic device and medium |
CN112579553A (en) * | 2020-12-15 | 2021-03-30 | 京东数字科技控股股份有限公司 | Method and apparatus for recording information |
CN112579553B (en) * | 2020-12-15 | 2024-05-17 | 京东科技控股股份有限公司 | Method and apparatus for recording information |
CN113360469A (en) * | 2021-06-25 | 2021-09-07 | 武汉众邦银行股份有限公司 | Structured low-storage log output method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110134658B (en) | 2024-05-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110134658A (en) | Log monitoring method, device, computer equipment and storage medium | |
US10977269B1 (en) | Selective structure preserving obfuscation | |
US11539748B2 (en) | Monitoring and reporting enterprise level cybersecurity remediation | |
US8103913B2 (en) | Application integration testing | |
US10891552B1 (en) | Automatic parser selection and usage | |
US8332929B1 (en) | Method and apparatus for process enforced configuration management | |
US10305962B1 (en) | Unit testing clients of web services | |
US9262519B1 (en) | Log data analysis | |
US7987449B1 (en) | Network for lifecycle management of firmware and software in electronic devices | |
CN109308285A (en) | Database script management method, device, computer equipment and storage medium | |
US11431691B2 (en) | Systems and methods for blockchain-based secure storage | |
CN110932918B (en) | Log data acquisition method and device and storage medium | |
CN112181423B (en) | Project construction method and device based on configuration file, computer equipment and medium | |
US20200167485A1 (en) | Systems and methods for data usage monitoring in multi-tenancy enabled hadoop clusters | |
CN109977644A (en) | Right management method is classified under a kind of Android platform | |
CN111048164A (en) | Medical big data long-term storage system | |
CN107832352A (en) | Daily record automatic processing method, device, storage medium and equipment | |
CN112685077A (en) | Data modification method, system, computer device and computer readable storage medium | |
CN114979109B (en) | Behavior track detection method, behavior track detection device, computer equipment and storage medium | |
CN115423273A (en) | Enterprise heterogeneous system integration method, device, equipment and storage medium | |
CN113722225A (en) | Page testing method and device, computer equipment and storage medium | |
CN111708795B (en) | Object identification generation method, object identification updating device, computer equipment and medium | |
CN113542232A (en) | Website data safety protection system based on big data | |
CN112929498B (en) | Multi-tenant voice call processing method, device, equipment and storage medium | |
CN110677483A (en) | Information processing system and trusted security management system |
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 |