CN107291600A - A kind of recording method and device of daily record - Google Patents
A kind of recording method and device of daily record Download PDFInfo
- Publication number
- CN107291600A CN107291600A CN201610202805.3A CN201610202805A CN107291600A CN 107291600 A CN107291600 A CN 107291600A CN 201610202805 A CN201610202805 A CN 201610202805A CN 107291600 A CN107291600 A CN 107291600A
- Authority
- CN
- China
- Prior art keywords
- level
- log
- logging
- functional module
- module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiments of the invention provide a kind of recording method and device of daily record, method therein includes:Determine the first logging level of application program;Determine the second logging level of functional module in the application program;Wherein, second logging level is set by the host computer of control system and obtained;When second logging level is less than first logging level, the second logging level according to the functional module records the corresponding daily record data of the functional module.The embodiment of the present invention can be realized logging level from meticulous procedure to functional module, when increasing the daily record data of certain functional module record, the daily record data of other functional modules record is not interfered with, so as to avoid system continually log, and then overhead can be reduced and systematic function is improved.
Description
Technical Field
The present invention relates to the field of semiconductor control, and in particular, to a method and an apparatus for recording a log.
Background
The system log is an indispensable part of semiconductor device control software, and is mainly used for recording various state information during system operation, and the information may specifically include information of an IAP (intelligent application Platform) library and information of an application program, and the like, which is of great help for system debugging and accident recall.
Generally, whether to log and the level of logging can be determined by a configuration file in the lower computer, for example, setting the logging level from low to high as: OTHER, VERBOSE, EVENT, PROBLEM, ERROR, FATAL. If the log record level set in the current configuration file is EVENT, all levels are higher than or equal to EVENT, that is, the system log data with the levels of EVENT, proplem, ERROR, and false will be recorded, and the system log data with the levels of VERBOSE and OTHER will be ignored.
In practical applications, when a program fails and needs to be debugged, the logging level of the application program may be generally configured as "OTHER", so that all logs in the running process of the application program may be logged, but this may cause the system to log frequently, thereby causing a large system overhead and resulting in a reduction in system performance.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a method and an apparatus for recording a log, which can reduce system overhead and improve system performance.
In order to solve the above problems, the present invention discloses a log recording method, which comprises:
determining a first logging level of an application;
determining a second logging level of a functional module in the application; the second log recording level is set by an upper computer of the control system;
and when the second log recording level is lower than the first log recording level, recording the log data corresponding to the functional module according to the second log recording level of the functional module.
Optionally, the first logging level is set by an upper computer of the control system.
Optionally, the method further comprises:
setting an initial level of the first logging level and the second logging level to the same level.
Optionally, the second logging level is set by:
and modifying the second log recording level through the upper computer, so that the modified second log recording level is lower than, or higher than or equal to the first log recording level.
Optionally, the first logging level is set by:
modifying, by the upper computer, the first logging level such that the modified first logging level is lower than, or higher than, or equal to the second logging level.
Optionally, the method further comprises:
and when the first logging level is lower than or equal to the second logging level, logging data corresponding to the functional module is recorded according to the first logging level of the application program.
Optionally, the method further comprises:
and storing the modified second log record level into a cache of a lower computer of the control system.
The invention discloses a log recording device, comprising:
a first determination module for determining a first log record level of an application;
the second determining module is used for determining a second log recording level of the functional module in the application program; the second log recording level is set by an upper computer of the control system; and
and the first log recording module is used for recording the log data corresponding to the functional module according to the second log recording level of the functional module when the second log recording level is lower than the first log recording level.
Optionally, the first logging level is set by an upper computer of the control system.
Optionally, the apparatus further comprises:
an initial setting module, configured to set an initial level of the first logging level and the second logging level to a same level.
Optionally, the apparatus further comprises: the second log recording level setting module is used for setting the second log recording level; the second logging level setting module includes:
and the first modification submodule is used for modifying the second logging level through the upper computer, so that the modified second logging level is lower than, or higher than or equal to the first logging level.
Optionally, the apparatus further comprises: the first log record level setting module is used for setting the first log record level; the first log record level setting module includes:
and the second modification submodule is used for modifying the first logging level through the upper computer, so that the modified first logging level is lower than, or higher than, or equal to the second logging level.
Optionally, the apparatus further comprises:
and the second logging module is used for recording the log data corresponding to the functional module according to the first logging level of the application program when the first logging level is lower than or equal to the second logging level.
Optionally, the apparatus further comprises:
and the cache module is used for storing the modified second log record level into a cache of a lower computer of the control system.
Compared with the prior art, the embodiment of the invention has the following advantages:
the embodiment of the invention can set the second log recording level of the functional module in the application program through the upper computer, and can record the log data corresponding to the functional module according to the second log recording level of the functional module when the second log recording level of the functional module in the application program is lower than the first log recording level of the application program in the process of recording the log so as to ensure that the log data of the functional module can be recorded according to the modified second log recording level when the second log recording level of the functional module is modified to a lower level, thereby realizing the purpose of thinning the log recording level from the program to the functional module and further realizing the purpose of modifying the log recording level of a certain functional module, and when the log data of the functional module is increased, the log recording level of other functional modules cannot be influenced, namely the log data of other functional modules cannot be increased, the system can be prevented from frequently recording logs, the system overhead is reduced, and the system performance is improved.
Drawings
FIG. 1 is a flow chart illustrating the steps of one embodiment of a method of logging in accordance with the present invention;
FIG. 2 is a flow chart of a method for logging in accordance with the present invention; and
fig. 3 shows a block diagram of a recording apparatus of a log according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The application program of the semiconductor control system may generally include a plurality of function modules, the log record level of all the function modules is default to the log record level of the application program at present, and if a certain function module, such as a manipulator driving module, needs to be debugged, the log record level of the whole application program may be modified to be an over-the-top, so that although all logs during the operation of the manipulator driving module can be recorded, the number of logs of OTHER function modules is increased at the same time, which causes the system to record log data frequently, thereby causing a large system overhead to cause a system performance decrease. One of the core ideas of the invention is that a second log recording level of a functional module in an application program is set through an upper computer, and the second log recording level is transmitted to a module log configuration file in a lower computer, so that the second log recording level takes effect in the process of recording logs, and when the second log recording level of the functional module is lower than the first log recording level of the application program, log data corresponding to the functional module can be recorded according to the second log recording level of the functional module, thereby realizing the purpose of thinning the log recording level from the program to the functional module, and further realizing the purpose of modifying the log recording level of a certain functional module without influencing the log recording levels of other functional modules.
Example one
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a log recording method according to the present invention is shown, which may specifically include:
step 101, determining a first log record level of an application program;
the first logging level can be used for representing a logging level corresponding to the whole application program, and the first logging level is stored in a program logging configuration file of a lower computer of the control system. Generally, the first logging level needs to be set through the lower computer, however, the operation on the lower computer often needs a strong professional technique, and the setting process is complicated, so the embodiment of the invention can set the first logging level through the upper computer, and transmit the set first logging level to the program logging configuration file of the lower computer, so that the set first logging level can take effect.
In the process of recording the log by the system, the first log recording level of the application program can be determined by analyzing the program log configuration file corresponding to the application program in the lower computer. For example, an illustration of a program log configuration file is given below:
< class: IO; first log level: PROBLEM; 0>
< class: ALARM; first log level: VERBOSE; 1>
< class: APP; first log level: an EVENT; 1>
The program log configuration file defines what kind of log is to be recorded, such as input/output IO, ALARM, application APP, etc., 1 represents recording the log data of the kind, and 0 represents ignoring the log data of the kind. The first logging level is used for specifying the lowest logging level during the operation of the system, and specifically, the first logging level from low to high may be set as: OTHER, VERBOSE, EVENT, PROBLEM, ERROR, FATAL. For example, in the above program log configuration file, the first log record level of the application APP configuration is EVENT, and then all levels are higher than or equal to EVENT, that is, application log data of the levels EVENT, proplem, ERROR, and fault will be recorded, and application log data of the levels VERBOSE and OTHER will be ignored.
In practical applications, the program log configuration file may be stored in a lower computer in an extensible markup Language (XML) format, so that when the system runs, the first log record level configured in the XML file may be read and parsed and corresponding log data may be recorded.
Step 102, determining a second log record level of a functional module in the application program; the second log recording level is set by an upper computer of the control system;
in order to modify the log recording level of a certain functional module without affecting the log recording levels of other functional modules, the embodiment of the invention adds a module log configuration file in the lower computer to configure the second log recording level of each functional module, thereby refining the log recording level from a program to the functional modules. The second log recording level can also be set through the upper computer, and the set second log recording level is transmitted to the module log configuration file of the lower computer through the upper computer, so that the set second log recording level can take effect. In the process of recording logs by the system, a second log recording level corresponding to a functional module in the application program can be determined by analyzing a module log configuration file in the lower computer.
In a preferred embodiment of the present invention, the method may further comprise the steps of:
setting an initial level of the first logging level and the second logging level to the same level.
In a specific application, the initial level of the first logging level and the second logging level may be set to the same level, so that in the initial case, the system logs in the same manner as the existing process. When more logs need to be recorded on a certain functional module without affecting the original log recording mode of other functional modules, the second log recording level can be set through the following steps:
and modifying the second log recording level through the upper computer, so that the modified second log recording level is lower than, or higher than or equal to the first log recording level. Or,
the first logging level may be set by:
modifying, by the upper computer, the first logging level such that the modified first logging level is lower than, or higher than, or equal to the second logging level.
According to the embodiment of the invention, the second log recording level or the first log recording level is modified to ensure that the second log recording level is different from the first log recording level, and logs with lower levels in the second log recording level and the first log recording level can be recorded in the system operation process. For example, if the second logging level of a functional module is modified to be lower than the first logging level, the system may record corresponding log data for the functional module according to the second logging level of the functional module. In a specific application, since the processes of modifying the second logging level and modifying the first logging level are similar, for convenience of description, the embodiment of the present invention is described by taking modifying the second logging level as an example, and the processes of modifying the first logging level are referred to each other.
It can be understood that the method for recording log data of different functional modules by setting the second log recording level of the functional module on the upper computer and transmitting the second log recording level to the module log configuration file in the lower computer is only a preferred implementation manner of the present invention, and in practical application, the present invention does not limit the specific implementation manner of refining the log recording level of the application program into the functional module. An illustration of a module log configuration file of the present invention is given below:
functional module 1< name: cfgSrcDriverSrcMatch; value: EVENT >
Functional module 2< name: cfgSrcDriverRobot; value: EVENT >
Functional module 3< name: cfgSrcDriverBarCode; value: EVENT >
The system comprises three functional modules, and the names of the functional modules are respectively as follows: the second log record level of the three functional modules is the initial level EVENT, and is the same as the first log record level of the APP in the program log configuration file. Assuming that the second log recording level of the manipulator driving module cfgSrcDriverRobot needs to be modified, so that the module only records log data above the ERROR level, the second log recording level of the functional module cfgSrcDriverRobot can be modified into ERROR by the upper computer, and the modified second log recording level is transmitted to a module log configuration file in the lower computer, namely the Value corresponding to the cfgSrcDriverRobot in the module log configuration file is modified into ERROR, during the process of recording logs by the system, the second log recording level of the manipulator driving module can be determined to be ERROR by analyzing the module log configuration file, and then the functional module records corresponding log data according to the ERROR log recording level. The second logging level of the other functional module is not modified, so the logged log is not changed.
In order to make the operation process of modifying the second log record level more intuitive, in a preferred embodiment of the present invention, the setting value of a certain functional module can be modified by adding an operation interface to the upper computer, the modified setting value is used as a parameter and is transmitted to a preset program in the lower computer to modify the second log record level of the functional module, and the program can be used for updating the setting value modified by the operation interface in the upper computer to a module log configuration file of the lower computer, so as to modify the second log record level of the functional module conveniently and quickly.
Referring to table 1, an example of a configuration item in an operation interface of the present invention is shown, which may specifically include: the function module name is used for identifying the corresponding function module; current value: a second logging level for indicating a current level of logging of the functional module; the current configuration value is: the second log record level is used for representing the second log record level which is stored in the cache of the lower computer but is not stored in the module log configuration file; setting values: for setting a second logging level of the functional module.
TABLE 1
| Function module name | Current value | Current configuration value | Set value |
| cfgSrcDriverBarCode | EVENT | EVENT | EVENT |
| cfgSrcDriverSrcMatch | EVENT | EVENT | EVENT |
| cfgSrcDriverRobot | EVENT | EVENT | ERROR |
For example, for a manipulator drive module, the name of the function module is "cfgSrcDriverRobot", and a pull-down entry named "ERROR" may be selected from the pull-down list of the corresponding setting value, that is, the second logging level of the function module may be set to ERROR. In the embodiment of the present invention, it is assumed that the corresponding log record levels in the pull-down list are sequentially set to be, last, EVENT, program, ERROR, and fault in order from low to high, and then the contents of the corresponding log records are sequentially reduced, where when the second log record level is set to be the lowest level, all logs of the function module may be recorded, and when the log record level is set to be ERROR, only logs at the ERROR and fault levels are recorded. Of course, in practical applications, those skilled in the art can flexibly set the category, number, and sequence of the first/second logging levels, and the present invention is not limited thereto.
Preferably, after the second log recording level of the functional module is modified in the operation interface of the upper computer, the modified second log recording level of the functional module may be stored only in the cache of the lower computer without being stored in the module log configuration file of the lower computer, and of course, in a specific application, the modified first log recording level may also be stored in the cache of the lower computer, which is similar to the storage process of the second log recording level and is not described herein again. Therefore, the modified second log record level can take effect when the cache related information is called in the current running process of the application program, namely, the log corresponding to the functional module can be recorded according to the second log record level in the cache before the system is restarted; and after the system is restarted, because the content in the cache is emptied, the system records the log according to the second log recording level of the functional module in the module log configuration file. As shown in table 1, the "current value" is the current second log record level of the functional module obtained from the program log configuration file of the lower computer; the "current configuration value" is the second log record level which is saved in the cache of the lower computer after being modified but not saved in the module log configuration file.
In practical application, two buttons, for example, an "application current" button and a "save" button, may be added to the operation interface of the upper computer, and after a second log record level of a certain functional module is modified in the operation interface, if the "application current" button is clicked, the modified second log record level is only saved into the cache of the lower computer, and becomes effective in the current running process of the application program, and after the system is restarted, the cache is emptied, the log of the functional module is recorded according to the unmodified second log record level in the module log configuration file; and if the 'save' button is clicked, the modified second log record level is saved in the module log configuration file of the lower computer, and the log of the functional module can still be recorded according to the second log record level before modification after the system is restarted.
Therefore, the second log recording level of each functional module can be configured on the operation interface of the upper computer according to needs to set which levels of log data are to be recorded, and the log data of other functional modules cannot be influenced.
In practical application, the module log configuration file may be stored in a lower computer in an extensible markup Language (XML) format, and when the system runs, the second log recording level of each functional module may be obtained by reading and analyzing the XML file.
And 103, when the second log recording level is lower than the first log recording level, recording the log data corresponding to the functional module according to the second log recording level of the functional module.
In specific application, after a program log configuration file and a module log configuration file in a lower computer are analyzed, a first log recording level of an application program and a second log recording level of a functional module can be obtained, in the process of recording log data corresponding to the functional module, the first log recording level and the second log recording level are compared, and the log data of the functional module can be recorded according to the modified second log recording level when the second log recording level of the functional module is modified to be a lower level by selecting the lower level for recording. When the second log recording level is lower than the first log recording level, recording the log data corresponding to the functional module according to the second log recording level; and when the first log record level is lower than or equal to the second log record level, recording the log data corresponding to the functional module according to the first log record level.
In an application example of the present invention, when a program of a cfgSrcDriverRobot function module is debugged, all logs of the function module need to be recorded to facilitate tracing analysis problems. At this time, the setting value corresponding to the cfgSrcDriverRobot function module in table 1 may be configured as "OTHER", and the second logging level of the OTHER unmodified function module is generally the same as the first logging level of the application program and defaults to be "EVENT". Because the second log recording level of the modified cfgSrcDriverRobot functional module is OTHER, which is lower than the first log recording level EVENT of the application program, the system records the cfgSrcDriverRobot functional module according to the OTHER log recording level in the process of recording logs, and the log data of the functional module is increased; and the second logging level of other functional modules is the same as the first logging level of the application program, and the logged log is not changed. Therefore, the log data required by debugging the cfgSrcDriveRobot function module is met, and the log data of other function modules cannot be increased.
In order to more clearly describe the logging method of the present invention, the following describes the whole process of the embodiment of the present invention in detail with reference to the above application examples.
Referring to fig. 2, a flow chart of a log recording method according to the present invention is shown, and specifically, the method may include the following steps:
step 201, acquiring a first log record level of a semiconductor system application program;
specifically, a first logging level of the semiconductor system application is obtained by parsing a program log configuration file of the lower computer, for example, the first logging level of the semiconductor system application is EVENT.
Step 202, acquiring a second log record level of a functional module in the semiconductor application program;
specifically, a second log record level of the cfgSrcDriverRobot functional module is obtained by analyzing a module log configuration file of the lower computer, for example, the second log record level of the cfgSrcDriverRobot is OTHER.
Step 203, judging whether the second log recording level is lower than the first log recording level, if so, executing step 204; otherwise, go to step 205;
the second logging level of the cfgSrcDriverRobot function module is set to be the lower of the first logging level and the second logging level, and in this embodiment, since the second logging level is lower than the first logging level, step 204 is performed.
Step 204, setting the second log record level of the functional module as a second log record level, and executing step 206;
step 205, setting the second log record level of the functional module as the first log record level;
and step 206, recording the logs of the functional module according to the second log recording level.
Specifically, corresponding log data is recorded according to the second log recording level of each functional module, all log data are recorded for the cfgSrcDriverRobot functional module, and only the log data higher than or equal to the EVENT log recording level are recorded for other functional modules with unmodified log recording levels.
To sum up, the embodiment of the present invention may set, in the upper computer, a second logging level of a functional module in an application program, and in the process of logging, when the second logging level of the functional module in the application program is lower than the first logging level of the application program, may record log data corresponding to the functional module according to the second logging level of the functional module, so as to ensure that when the second logging level of the functional module is modified to a lower level, the log data of the functional module may be recorded according to the modified second logging level, thereby implementing refinement of the logging level from the program to the functional module, further implementing modification of the logging level of a certain functional module, and when the log data of the functional module is increased, the logging level of other functional modules is not affected, that is, the log data of other functional modules is not increased, the system can be prevented from recording logs frequently, the system overhead is reduced, and the system performance is improved;
in addition, the embodiment of the invention modifies the setting value of a certain functional module by adding an operation interface on the upper computer, and transmits the modified setting value as a parameter to a preset program in the lower computer to modify the second log record level of the functional module, wherein the program can be used for updating the setting value modified by the operation interface in the upper computer into a module log configuration file of the lower computer, so that the second log record level of the functional module can be modified conveniently and quickly without strong professional technical knowledge;
furthermore, the embodiment of the present invention may further store the second log recording level of the modified functional module in the module log configuration file of the lower computer, but only in the cache of the lower computer, so that the modified second log recording level is only effective in the current running process of the application program, and after the system is restarted, the second log recording level of the functional module may be restored to the value before modification, so as to meet the modification requirements of multiple log recording levels.
Device embodiment
Referring to fig. 3, a block diagram of a structure of an embodiment of a log recording apparatus of the present invention is shown, which may specifically include:
a first determining module 310 for determining a first logging level of an application;
a second determining module 320, configured to determine a second logging level of a functional module in the application; the second log recording level is set by an upper computer of the control system; and
the first log recording module 330 is configured to record, when the second log recording level is lower than the first log recording level, log data corresponding to the functional module according to the second log recording level of the functional module.
In a preferred embodiment of the invention, the first logging level is set by a host computer of the control system.
In another preferred embodiment of the present invention, the apparatus may further include:
an initial setting module, configured to set an initial level of the first logging level and the second logging level to a same level.
In still another preferred embodiment of the present invention, the apparatus may further include: the second log recording level setting module is used for setting the second log recording level; the second logging level setting module includes:
and the first modification submodule is used for modifying the second logging level through the upper computer, so that the modified second logging level is lower than, or higher than or equal to the first logging level.
In still another preferred embodiment of the present invention, the apparatus may further include: the first log record level setting module is used for setting the first log record level; the first log record level setting module includes:
and the second modification submodule is used for modifying the first logging level through the upper computer, so that the modified first logging level is lower than, or higher than, or equal to the second logging level.
In still another preferred embodiment of the present invention, the apparatus may further include:
and the second logging module is used for recording the log data corresponding to the functional module according to the first logging level of the application program when the first logging level is lower than or equal to the second logging level.
In still another preferred embodiment of the present invention, the apparatus may further include:
and the cache module is used for storing the modified second log record level into a cache of a lower computer of the control system.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method and the device for recording the log provided by the invention are described in detail, and a specific example is applied in the text to explain the principle and the implementation of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (14)
1. A method of logging, the method comprising:
determining a first logging level of an application;
determining a second logging level of a functional module in the application; the second log recording level is set by an upper computer of the control system;
and when the second log recording level is lower than the first log recording level, recording the log data corresponding to the functional module according to the second log recording level of the functional module.
2. The method of claim 1, wherein the first logging level is set by a host computer of a control system.
3. The method of claim 1, wherein the method further comprises:
setting an initial level of the first logging level and the second logging level to the same level.
4. The method of claim 1, wherein the second logging level is set by:
and modifying the second log recording level through the upper computer, so that the modified second log recording level is lower than, or higher than or equal to the first log recording level.
5. The method of claim 2, wherein the first logging level is set by:
modifying, by the upper computer, the first logging level such that the modified first logging level is lower than, or higher than, or equal to the second logging level.
6. The method of claim 1, wherein the method further comprises:
and when the first logging level is lower than or equal to the second logging level, logging data corresponding to the functional module is recorded according to the first logging level of the application program.
7. The method of claim 4, wherein the method further comprises:
and storing the modified second log record level into a cache of a lower computer of the control system.
8. An apparatus for recording a log, the apparatus comprising:
a first determination module for determining a first log record level of an application;
the second determining module is used for determining a second log recording level of the functional module in the application program; the second log recording level is set by an upper computer of the control system; and
and the first log recording module is used for recording the log data corresponding to the functional module according to the second log recording level of the functional module when the second log recording level is lower than the first log recording level.
9. The apparatus of claim 8, wherein the first logging level is set by a host computer of a control system.
10. The apparatus of claim 8, wherein the apparatus further comprises:
an initial setting module, configured to set an initial level of the first logging level and the second logging level to a same level.
11. The apparatus of claim 8, wherein the apparatus further comprises: the second log recording level setting module is used for setting the second log recording level; the second logging level setting module includes:
and the first modification submodule is used for modifying the second logging level through the upper computer, so that the modified second logging level is lower than, or higher than or equal to the first logging level.
12. The apparatus of claim 9, wherein the apparatus further comprises: the first log record level setting module is used for setting the first log record level; the first log record level setting module includes:
and the second modification submodule is used for modifying the first logging level through the upper computer, so that the modified first logging level is lower than, or higher than, or equal to the second logging level.
13. The apparatus of claim 8, wherein the apparatus further comprises:
and the second logging module is used for recording the log data corresponding to the functional module according to the first logging level of the application program when the first logging level is lower than or equal to the second logging level.
14. The apparatus of claim 8, wherein the apparatus further comprises:
and the cache module is used for storing the modified second log record level into a cache of a lower computer of the control system.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610202805.3A CN107291600B (en) | 2016-03-31 | 2016-03-31 | Log recording method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610202805.3A CN107291600B (en) | 2016-03-31 | 2016-03-31 | Log recording method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN107291600A true CN107291600A (en) | 2017-10-24 |
| CN107291600B CN107291600B (en) | 2021-01-08 |
Family
ID=60087400
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610202805.3A Active CN107291600B (en) | 2016-03-31 | 2016-03-31 | Log recording method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107291600B (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109165147A (en) * | 2018-08-10 | 2019-01-08 | 北京奇艺世纪科技有限公司 | Log print control program, device, system, back-end server and headend equipment |
| CN110058935A (en) * | 2019-04-26 | 2019-07-26 | 广州华多网络科技有限公司 | Log rank method of adjustment, apparatus and system, readable storage medium storing program for executing |
| CN110932904A (en) * | 2019-11-29 | 2020-03-27 | 新华三半导体技术有限公司 | Key log recording method and device and network equipment |
| CN112394862A (en) * | 2019-08-16 | 2021-02-23 | 台达电子工业股份有限公司 | The control method of the upper computer |
| CN113448818A (en) * | 2021-07-01 | 2021-09-28 | 山东浪潮通软信息科技有限公司 | Log tracking method, device and medium based on probability |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6539341B1 (en) * | 2000-11-06 | 2003-03-25 | 3Com Corporation | Method and apparatus for log information management and reporting |
| CN101464908A (en) * | 2009-01-14 | 2009-06-24 | 北京北方微电子基地设备工艺研究中心有限责任公司 | Log recording method and device |
| CN104461844A (en) * | 2014-10-31 | 2015-03-25 | 大唐移动通信设备有限公司 | Log service method based on rule |
-
2016
- 2016-03-31 CN CN201610202805.3A patent/CN107291600B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6539341B1 (en) * | 2000-11-06 | 2003-03-25 | 3Com Corporation | Method and apparatus for log information management and reporting |
| CN101464908A (en) * | 2009-01-14 | 2009-06-24 | 北京北方微电子基地设备工艺研究中心有限责任公司 | Log recording method and device |
| CN104461844A (en) * | 2014-10-31 | 2015-03-25 | 大唐移动通信设备有限公司 | Log service method based on rule |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109165147A (en) * | 2018-08-10 | 2019-01-08 | 北京奇艺世纪科技有限公司 | Log print control program, device, system, back-end server and headend equipment |
| CN110058935A (en) * | 2019-04-26 | 2019-07-26 | 广州华多网络科技有限公司 | Log rank method of adjustment, apparatus and system, readable storage medium storing program for executing |
| CN110058935B (en) * | 2019-04-26 | 2022-07-22 | 广州方硅信息技术有限公司 | Log level adjusting method, device and system and readable storage medium |
| CN112394862A (en) * | 2019-08-16 | 2021-02-23 | 台达电子工业股份有限公司 | The control method of the upper computer |
| CN112394862B (en) * | 2019-08-16 | 2022-02-22 | 台达电子工业股份有限公司 | Control method of upper computer |
| CN110932904A (en) * | 2019-11-29 | 2020-03-27 | 新华三半导体技术有限公司 | Key log recording method and device and network equipment |
| CN110932904B (en) * | 2019-11-29 | 2022-08-09 | 新华三半导体技术有限公司 | Key log recording method and device and network equipment |
| CN113448818A (en) * | 2021-07-01 | 2021-09-28 | 山东浪潮通软信息科技有限公司 | Log tracking method, device and medium based on probability |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107291600B (en) | 2021-01-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107291600B (en) | Log recording method and device | |
| Ocariza et al. | An empirical study of client-side JavaScript bugs | |
| US8949799B2 (en) | Program log record optimization | |
| US9612937B2 (en) | Determining relevant events in source code analysis | |
| CN105446874B (en) | A kind of detection method and device of resource distribution file | |
| US20120036397A1 (en) | Utilizing log event ontology to deliver user role specific solutions for problem determination | |
| US9588945B2 (en) | Comparing webpage elements having asynchronous functionality | |
| US20150081875A1 (en) | Method and system for operating system (os) verification | |
| CN111679976A (en) | Method and device for searching page object | |
| CN112231197A (en) | Page testing method and device and storage medium | |
| AU2017279795A1 (en) | Metadata-driven program code generation for clinical data analysis | |
| CN111615688A (en) | Assertion verification code binding method and device | |
| CN114138244A (en) | Method and device for automatically generating model files, storage medium and electronic equipment | |
| CN114003269A (en) | Component processing method, device, electronic device and storage medium | |
| JP5976209B2 (en) | Program analysis apparatus, program analysis method, and program analysis program | |
| CN112306568A (en) | Service instance configuration method and device, electronic equipment and storage medium | |
| CN116661758B (en) | Method, device, electronic equipment and medium for optimizing log framework configuration | |
| CN110764746B (en) | Script generation method and device and computer readable storage medium | |
| US20140245159A1 (en) | Transport script generation based on a user interface script | |
| CN113704020B (en) | Method and device for analyzing error field data of solid-state hard disk | |
| JP6516343B2 (en) | Application user interface automatic test method, electronic device, system and storage medium | |
| CN115185852A (en) | UI automation testing method and system, computer equipment | |
| CN114385489A (en) | Front-end development code detection method, device and storage medium | |
| CN113946509A (en) | Buried point search and comparison method and device, computing device and readable storage medium | |
| CN103761247B (en) | A kind of processing method and processing device of error file |
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 |