CN113687973A - Method, device and medium for controlling dynamic output of logs - Google Patents

Method, device and medium for controlling dynamic output of logs Download PDF

Info

Publication number
CN113687973A
CN113687973A CN202111004801.1A CN202111004801A CN113687973A CN 113687973 A CN113687973 A CN 113687973A CN 202111004801 A CN202111004801 A CN 202111004801A CN 113687973 A CN113687973 A CN 113687973A
Authority
CN
China
Prior art keywords
instance object
log
matching
attribute
internal structure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111004801.1A
Other languages
Chinese (zh)
Other versions
CN113687973B (en
Inventor
赵洋
孟珂
赵海兴
李照川
罗超
徐克龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chaozhou Zhuoshu Big Data Industry Development Co Ltd
Original Assignee
Chaozhou Zhuoshu Big Data Industry Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chaozhou Zhuoshu Big Data Industry Development Co Ltd filed Critical Chaozhou Zhuoshu Big Data Industry Development Co Ltd
Priority to CN202111004801.1A priority Critical patent/CN113687973B/en
Publication of CN113687973A publication Critical patent/CN113687973A/en
Application granted granted Critical
Publication of CN113687973B publication Critical patent/CN113687973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0775Content or structure details of the error report, e.g. specific table structure, specific error fields
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0781Error filtering or prioritizing based on a policy defined by the user or on a policy defined by a hardware/software module, e.g. according to a severity level
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method, equipment and medium for controlling log dynamic output, wherein the method comprises the following steps: determining a program function interface, and acquiring an instance object through the program function interface; reflecting the instance object to obtain an internal structure of the instance object; and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs the log through the program function interface according to the matching result. By dynamically controlling the output of the log, the log output is more flexible and convenient, redundant codes and repetitive work caused by the log control under special conditions are greatly reduced, the log is completely output according to the output conditions required by developers, the output of useless logs is reduced, the waste of server resources is reduced, in addition, the internal structure of the instance object is obtained in a reflection mode, the codes are more flexible, and the expandability of application is greatly improved.

Description

Method, device and medium for controlling dynamic output of logs
Technical Field
The application relates to the technical field of internet, in particular to a method, equipment and medium for controlling dynamic output of logs.
Background
With the rapid development of global internet technology, various internet products or systems emerge endlessly, and various development languages are also widely used and developed. In internet products or systems, log recording is an essential part in program operation, almost every internet product or system has a log system, every development language also has its own log framework and module, and the log is very important for the internet products or systems.
However, because of the high user throughput, the internet product or system is very resource consuming to log out in some scenarios that require recording special parameters such as large fields. However, it is difficult to perform targeted control on log output by using the conventional log output method, and therefore it is very important to provide a dynamic log control method.
Disclosure of Invention
In order to solve the problem that targeted dynamic control cannot be performed on the output of the log in the prior art, the application provides a method, a device and a medium for controlling log dynamic output, and the method comprises the following steps:
on one hand, the application provides a method for controlling log dynamic output, which comprises the following steps: determining a program function interface, and acquiring an instance object through the program function interface; performing reflection processing on the instance object to obtain an internal structure of the instance object; and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
In one example, before determining a program function interface and obtaining an instance object through the program function interface, the method further comprises: determining a matching object class name needing to control log output; acquiring a plurality of attribute names contained in the matching object class name, and selecting the matching attribute names from the plurality of attribute names to control the output of the log; acquiring a plurality of attribute values contained in the matching attribute name, and selecting the matching attribute value which needs to control the log output from the plurality of attribute values; determining a constraint condition corresponding to the matching attribute value, wherein the type of the constraint condition at least comprises: a permitted log output type and a prohibited log output type; and adding the class name, the matching attribute value and the constraint condition of the matching object to a class data source as the matching condition of the class data source and the instance object.
In one example, matching the internal structure with a corresponding matching condition in a class data source, and determining whether the instance object outputs a log through the program function interface according to a matching result specifically includes: acquiring an instance object class name through the internal structure, and judging whether a matching object class name which is the same as the instance object class name exists in a class data source or not; if not, determining whether the instance object outputs a log according to a pre-stored code; if yes, obtaining an instance object attribute name and a plurality of instance object attribute values contained in the instance object attribute name through the internal structure; querying a matching attribute value matched with the instance object attribute value and a constraint condition corresponding to the matching attribute value through the class data source; and obtaining a calculation result according to the constraint condition and a pre-stored first algorithm, wherein the calculation result is used for determining whether the instance object outputs a log through the program function interface.
In one example, after obtaining the calculation result according to the constraint condition and a pre-stored first algorithm, the method further includes: determining that the number of the instance object attribute names is not less than two; and determining to obtain a plurality of calculation results, and controlling the program function interface to output or not output the log of the instance object according to a pre-stored second algorithm and the plurality of calculation results.
In one example, before obtaining, through the internal structure, an instance object attribute name and a plurality of instance object attribute values included under the instance object attribute name, the method includes: determining that private attribute access rights exist for the internal structure; and acquiring the private attribute access authority through a pre-stored operation algorithm.
In one example, acquiring, by the internal structure, an instance object attribute name and a plurality of instance object attribute values included in the instance object attribute name specifically include: acquiring an attribute extraction algorithm corresponding to the internal structure; and operating the attribute extraction algorithm to obtain an instance object attribute name and a plurality of instance object attribute values contained in the instance object attribute name.
In one example, the performing reflection processing on the instance object to obtain the internal structure of the instance object specifically includes: adding a JAVA reflection algorithm on the program function interface, wherein the JAVA reflection algorithm is used for carrying out real-time reflection processing on the instance object; acquiring a byte code file of the instance object through the JAVA reflection algorithm, and writing the byte code file into a class name file which is created in advance in a memory; the internal structure of the instance object is obtained.
In one example, the method further comprises: determining that an output log exists at the program function interface; and storing the log into a corresponding log file according to the grade of the log.
On the other hand, the present application provides a control device for log dynamic output, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to: determining a program function interface, and acquiring an instance object through the program function interface; performing reflection processing on the instance object to obtain an internal structure of the instance object; and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
In another aspect, the present application provides a non-transitory computer storage medium storing computer-executable instructions configured to: determining a program function interface, and acquiring an instance object through the program function interface; performing reflection processing on the instance object to obtain an internal structure of the instance object; and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
The method, the device and the medium for controlling the log dynamic output can bring the following beneficial effects: by dynamically outputting and controlling the logs, the log output is more flexible and convenient, redundant codes and repetitive work caused by log control under special conditions are greatly reduced, the logs are completely output according to the output conditions required by developers, the output of useless logs is reduced, and the waste of server resources is reduced. In addition, the internal structure of the instance object is obtained in a reflection mode, so that the code is more flexible, and the expandability of the application is greatly improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a control method for log dynamic output according to an embodiment of the present application;
fig. 2 is a schematic diagram of a control device for log dynamic output in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart illustrating a method for controlling log dynamic output on a server side according to one or more embodiments of the present disclosure. The method can be applied to different business fields, such as the field of internet financial business, the field of electric business, the field of instant messaging business, the field of game business, the field of official business and the like. The process can be executed by computing equipment in the corresponding field (such as an intelligent customer service server or an intelligent mobile terminal corresponding to the payment service, and the like), and certain input parameters or intermediate results in the process allow manual intervention and adjustment to help improve the accuracy.
It should be noted that, the control method for log dynamic output described in this application is stored in a corresponding system or server, and a user may log in the system or server through a corresponding terminal, where the terminal types include, but are not limited to: the mobile phone, the tablet computer, the personal computer or other hardware devices with corresponding processing and communication functions. In addition, the user can log in the corresponding system arranged in the terminal through modes of APP or WEB login and the like, and carries out calculation processing through a processor inside the terminal or executes a corresponding scheme through a mode of communication with a remote server in combination with a processing result sent by the server so as to realize dynamic output control of the log in the application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
As shown in fig. 1, a method for controlling log dynamic output provided in an embodiment of the present application includes:
s101: and determining a program function interface, and acquiring an instance object through the program function interface.
Specifically, the system needs to determine a program function interface for implementing the present solution, where the program function interface can pass through a corresponding instance object, where the instance object is explained by taking an operation code or an execution code of a program as an example.
The program function interface can package the output function of the log, including the level of the log, the format of the log, the parameters of the log, error information and the like, by the corresponding strategy given to the program function interface, and receive the instance object associated with the log through the program function interface to determine whether the log corresponding to the instance object needs to be output.
In addition, before the system determines the program function interface and acquires the instance object through the program function interface, the system also needs to configure a matching condition with the instance object for the class data source.
The class data source is connected to the program function interface, and is configured to provide a corresponding filtering rule, and when the system receives the instance object through the program function interface, the instance object may be compared with the class data source to determine whether the instance object needs to output a log.
The configuring of the matching condition with the instance object for the class data source specifically includes: firstly, a matching object class name for controlling log output needs to be determined, and the matching object class name is used for indicating that all objects belonging to the class name need to be subjected to log control output.
Further, the system may obtain a plurality of attribute names included in the class name of the matching object, where the class name of each object includes a plurality of attribute names, and when one or more attribute names need to be log-controlled and output, the system may select a matching attribute name that needs to be log-controlled and output from the plurality of attribute names.
Each attribute name comprises a plurality of attribute values, and when one or more attribute values need to be subjected to log control output, the system can select and obtain a matched attribute value which needs to be subjected to log control output from the plurality of attribute values.
After the matching attribute value is determined, log control output is performed on the matching attribute value, and at this time, a corresponding constraint condition needs to be configured for the matching attribute value, where the type of the constraint condition at least includes: a log output enabled type and a log output disabled type. For example, if an instance object includes a matching attribute value and the constraint condition corresponding to the matching attribute value is a no log output type, then no log output is performed on the instance object.
The system adds the class name, the matching attribute value and the constraint condition of the matching object to a class data source as the matching condition of the class data source and the instance object.
S102: and carrying out reflection processing on the example object to obtain the internal structure of the example object.
Specifically, the system adds a JAVA reflection algorithm on the program function interface, where the JAVA reflection algorithm is used to perform the real-time reflection processing on the instance object. In the embodiment of the present application, the JAVA reflection algorithm is implemented based on the JAVA reflection technology.
Further, the system can obtain the bytecode file of the instance object through a JAVA reflection algorithm, and write the bytecode file into a class name file created in advance in the memory, so as to obtain the internal structure of the instance object.
The internal structure may reflect the class name, attribute name, and attribute value of the instance object.
S103: and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
Specifically, the system obtains the name of the instance object class through the internal structure of the instance object, and judges whether the matching object class name with the same name of the instance object class exists in the class data source.
If the log does not exist, it indicates that the instance object does not need to perform log output control, and at this time, whether the instance object outputs the log may be determined according to a pre-stored code, for example, whether the instance object needs to output the log may be determined by determining the level of the instance object.
If the instance object exists, the instance object needs to be subjected to log output control. And acquiring the attribute name of the instance object and a plurality of instance object attribute values contained in the attribute name of the instance object through an internal structure. And then, querying a matching attribute value matched with the attribute value of the instance object and a constraint condition corresponding to the matching attribute value through the class data source.
It should be noted that, the attribute value of the instance object may correspond to multiple matching attribute values, and further correspond to multiple constraint conditions, and due to different constraint conditions, the instance object may have a situation that log output is allowed and log output is prohibited at the same time.
The system prestores a corresponding algorithm (referred to as a first algorithm) for processing a plurality of constraints, the first algorithm is introduced for solving the problem, and whether the instance object needs to output the log can be determined according to a corresponding priority rule or a mode of ignoring some constraints when a plurality of constraints exist simultaneously. Specifically, the system obtains a calculation result according to the constraint condition and a pre-stored first algorithm, and the calculation result is used for determining whether the instance object outputs the log through the program function interface.
In addition, the above case is only for the case where the instance object attribute values belong to the same instance object attribute name. And when the number of the attribute names of the instance object is not less than two, the matching attribute names matched with the attribute names of the instance object are not less than two.
At this time, each instance attribute name finally obtains a calculation result, the system determines to obtain a plurality of calculation results, and at this time, a situation that log output is allowed and log output is prohibited may exist simultaneously among the plurality of calculation results. Specifically, the control program function interface outputs or does not output the log of the instance object according to a pre-stored second algorithm and a plurality of calculation results.
In one embodiment, before the system obtains the instance object attribute name and the plurality of instance object attribute values contained in the instance object attribute name through the internal structure, it can also be determined that the internal structure has the private attribute access authority, at this time, the system can obtain the private attribute access authority through a pre-stored operation algorithm, and further obtain the instance object attribute name and the instance object attribute values through the internal structure.
In one embodiment, the system obtains, through an internal structure, an instance object attribute name and a plurality of instance object attribute values included in the instance object attribute name, and specifically includes: the system obtains an attribute extraction algorithm corresponding to the internal structure, and obtains an instance object attribute name and a plurality of instance object attribute values contained in the instance object attribute name according to the attribute extraction algorithm.
In one embodiment, the system may further determine that an output log exists at the program function interface, and further store the log into a corresponding log file according to the level of the log, so as to implement classification management on the log, where the log level at least includes: DEBUG, INFO, WARN, ERROR, FATAL, etc.
In an embodiment, as shown in fig. 2, an embodiment of the present application further provides a control device for log dynamic output, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform instructions for:
determining a program function interface, and acquiring an instance object through the program function interface;
performing reflection processing on the instance object to obtain an internal structure of the instance object;
and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
In one embodiment, the present application further provides a non-transitory computer storage medium storing computer-executable instructions configured to:
determining a program function interface, and acquiring an instance object through the program function interface;
performing reflection processing on the instance object to obtain an internal structure of the instance object;
and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
By dynamically controlling the output of the log, the log output is more flexible and convenient, redundant codes and repetitive work caused by the log control under special conditions are greatly reduced, the log is completely output according to the output conditions required by developers, the output of useless logs is reduced, the waste of server resources is reduced, in addition, the internal structure of the instance object is obtained in a reflection mode, the codes are more flexible, and the expandability of application is greatly improved.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device and media embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference may be made to some descriptions of the method embodiments for relevant points.
The device and the medium provided by the embodiment of the application correspond to the method one to one, so the device and the medium also have the similar beneficial technical effects as the corresponding method, and the beneficial technical effects of the method are explained in detail above, so the beneficial technical effects of the device and the medium are not repeated herein.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, 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 apparatus 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 apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. 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 apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A control method for log dynamic output is characterized by comprising the following steps:
determining a program function interface, and acquiring an instance object through the program function interface;
performing reflection processing on the instance object to obtain an internal structure of the instance object;
and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
2. The method of claim 1, wherein before determining a procedural function interface and obtaining an instance object through the procedural function interface, the method further comprises:
determining a matching object class name needing to control log output;
acquiring a plurality of attribute names contained in the matching object class name, and selecting the matching attribute names from the plurality of attribute names to control the output of the log;
acquiring a plurality of attribute values contained in the matching attribute name, and selecting the matching attribute value which needs to control the log output from the plurality of attribute values;
determining a constraint condition corresponding to the matching attribute value, wherein the type of the constraint condition at least comprises: a permitted log output type and a prohibited log output type;
and adding the class name, the matching attribute value and the constraint condition of the matching object to a class data source as the matching condition of the class data source and the instance object.
3. The method according to claim 1, wherein the step of matching the internal structure with a corresponding matching condition in a class data source and determining whether the instance object outputs the log through the program function interface according to a matching result includes:
acquiring an instance object class name through the internal structure, and judging whether a matching object class name which is the same as the instance object class name exists in a class data source or not;
if not, determining whether the instance object outputs a log according to a pre-stored code;
if yes, obtaining an instance object attribute name and a plurality of instance object attribute values contained in the instance object attribute name through the internal structure; querying a matching attribute value matched with the instance object attribute value and a constraint condition corresponding to the matching attribute value through the class data source; and obtaining a calculation result according to the constraint condition and a pre-stored first algorithm, wherein the calculation result is used for determining whether the instance object outputs a log through the program function interface.
4. The method for controlling log dynamic output according to claim 3, wherein after obtaining the calculation result according to the constraint condition and a pre-stored first algorithm, the method further comprises:
determining that the number of the instance object attribute names is not less than two;
and determining to obtain a plurality of calculation results, and controlling the program function interface to output or not output the log of the instance object according to a pre-stored second algorithm and the plurality of calculation results.
5. The method according to claim 3, wherein before obtaining the instance object attribute name and the plurality of instance object attribute values contained under the instance object attribute name via the internal structure, the method comprises:
determining that private attribute access rights exist for the internal structure;
and acquiring the private attribute access authority through a pre-stored operation algorithm.
6. The method according to claim 3, wherein obtaining the property name of the instance object and the property values of the multiple instance objects included in the property name of the instance object through the internal structure specifically includes:
acquiring an attribute extraction algorithm corresponding to the internal structure;
and operating the attribute extraction algorithm to obtain an instance object attribute name and a plurality of instance object attribute values contained in the instance object attribute name.
7. The method according to claim 1, wherein the performing reflection processing on the instance object to obtain the internal structure of the instance object specifically includes:
adding a JAVA reflection algorithm on the program function interface, wherein the JAVA reflection algorithm is used for carrying out real-time reflection processing on the instance object;
acquiring a byte code file of the instance object through the JAVA reflection algorithm, and writing the byte code file into a class name file which is created in advance in a memory;
the internal structure of the instance object is obtained.
8. The method for controlling log dynamized output according to claim 1, wherein the method further comprises:
determining that an output log exists at the program function interface;
and storing the log into a corresponding log file according to the grade of the log.
9. A control apparatus for log dynamic output, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform instructions for:
determining a program function interface, and acquiring an instance object through the program function interface;
performing reflection processing on the instance object to obtain an internal structure of the instance object;
and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
10. A non-transitory computer storage medium storing computer-executable instructions, the computer-executable instructions configured to:
determining a program function interface, and acquiring an instance object through the program function interface;
performing reflection processing on the instance object to obtain an internal structure of the instance object;
and matching the internal structure with the corresponding matching condition in the class data source, and determining whether the instance object outputs a log through the program function interface according to the matching result.
CN202111004801.1A 2021-08-30 2021-08-30 Control method, equipment and medium for log dynamic output Active CN113687973B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111004801.1A CN113687973B (en) 2021-08-30 2021-08-30 Control method, equipment and medium for log dynamic output

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111004801.1A CN113687973B (en) 2021-08-30 2021-08-30 Control method, equipment and medium for log dynamic output

Publications (2)

Publication Number Publication Date
CN113687973A true CN113687973A (en) 2021-11-23
CN113687973B CN113687973B (en) 2024-06-25

Family

ID=78584037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111004801.1A Active CN113687973B (en) 2021-08-30 2021-08-30 Control method, equipment and medium for log dynamic output

Country Status (1)

Country Link
CN (1) CN113687973B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138609A (en) * 2021-12-06 2022-03-04 Oppo广东移动通信有限公司 A log output control method, device, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488412A (en) * 2015-06-19 2016-04-13 哈尔滨安天科技股份有限公司 Malicious code detection method and system based on android terminal log
US20160328488A1 (en) * 2015-05-08 2016-11-10 Seth Lytle Structure linked native query database management system and methods
US9800455B1 (en) * 2012-02-08 2017-10-24 Amazon Technologies, Inc. Log monitoring system
US20180285008A1 (en) * 2017-03-29 2018-10-04 The Travelers Indemnity Company Multi-server system resource manager
CN111488439A (en) * 2020-03-18 2020-08-04 杭州迪普科技股份有限公司 System and method for saving and analyzing log data
CN111881012A (en) * 2020-08-10 2020-11-03 深圳大势智能科技有限公司 Log recording method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9800455B1 (en) * 2012-02-08 2017-10-24 Amazon Technologies, Inc. Log monitoring system
US20160328488A1 (en) * 2015-05-08 2016-11-10 Seth Lytle Structure linked native query database management system and methods
CN105488412A (en) * 2015-06-19 2016-04-13 哈尔滨安天科技股份有限公司 Malicious code detection method and system based on android terminal log
US20180285008A1 (en) * 2017-03-29 2018-10-04 The Travelers Indemnity Company Multi-server system resource manager
CN111488439A (en) * 2020-03-18 2020-08-04 杭州迪普科技股份有限公司 System and method for saving and analyzing log data
CN111881012A (en) * 2020-08-10 2020-11-03 深圳大势智能科技有限公司 Log recording method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
YUTO HAMA 等: "Performance of Polar Code MIMO Systems with Matched-Filter Detector and Interference Cancellation", IEEE, 27 February 2020 (2020-02-27), pages 1 - 6 *
徐杨;袁峰;林琪;汤德佑;李东;: "基于混合人工免疫算法的流程挖掘事件日志融合方法", 软件学报, no. 02, 24 March 2017 (2017-03-24), pages 176 - 196 *
范惊;章程;: "基于静态分析的高精度程序日志解析技术", 计算机工程, no. 10, 15 October 2013 (2013-10-15), pages 74 - 77 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138609A (en) * 2021-12-06 2022-03-04 Oppo广东移动通信有限公司 A log output control method, device, electronic device and storage medium

Also Published As

Publication number Publication date
CN113687973B (en) 2024-06-25

Similar Documents

Publication Publication Date Title
CN110704037B (en) Rule engine implementation method and device
CN110032599B (en) Data structure reading and updating method and device, and electronic equipment
CN113079200A (en) Data processing method, device and system
CN112947934A (en) Method, device and medium for dynamically transforming business logic
CN111400681A (en) Data permission processing method, device and equipment
CN108134812B (en) Data processing method and device
CN110928941A (en) A method and device for extracting data slices
CN111240987B (en) Method and device for detecting migration program, electronic equipment and computer readable storage medium
EP4346191A1 (en) Data processing method, and apparatus
CN113687973B (en) Control method, equipment and medium for log dynamic output
CN114791884A (en) Test environment construction method and device, storage medium and electronic equipment
CN110941443A (en) Method, device and electronic device for modifying file name in SDK
CN116414433A (en) Resource packaging method, device, equipment and computer readable medium
CN111177093A (en) Method, device and medium for sharing scientific and technological resources
CN117389660A (en) Method and system for detecting jar packet homonymy
CN117687920A (en) Interface testing method and device, storage medium and electronic equipment
CN112000366B (en) System parameter configuration method and device based on code generator
CN115314573A (en) Dynamic loading method and device for message body, electronic equipment and storage medium
CN112860552A (en) Key word system operation method and device
CN115269064B (en) Service processing method and device
CN110633214A (en) Configuration method and device of internal test message
CN111124931B (en) Java code compliance checking method and device
CN107479899B (en) File processing method and device, storage medium and processor
CN110716746B (en) Method and device for converting RN style code into applet style code
CN114281377A (en) Block chain system management method and device based on metadata

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