Movatterモバイル変換


[0]ホーム

URL:


CN107491382B - Log output method and device - Google Patents

Log output method and device
Download PDF

Info

Publication number
CN107491382B
CN107491382BCN201710600408.6ACN201710600408ACN107491382BCN 107491382 BCN107491382 BCN 107491382BCN 201710600408 ACN201710600408 ACN 201710600408ACN 107491382 BCN107491382 BCN 107491382B
Authority
CN
China
Prior art keywords
log
output
service
description language
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710600408.6A
Other languages
Chinese (zh)
Other versions
CN107491382A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co LtdfiledCriticalBeijing Jingdong Century Trading Co Ltd
Priority to CN201710600408.6ApriorityCriticalpatent/CN107491382B/en
Publication of CN107491382ApublicationCriticalpatent/CN107491382A/en
Application grantedgrantedCritical
Publication of CN107491382BpublicationCriticalpatent/CN107491382B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The embodiment of the invention provides a log output method and device, and relates to the technical field of computers. The method comprises the following steps: dividing a service system into one or more service modules according to a service scene, and respectively configuring a multiplexing description language for each service module; writing a buried point in a service module to acquire log data; and analyzing the multiplexing description language, calling a log manager configured for each service module to respectively process log data when analyzing that the embedded points are configured in a plurality of service modules, and correspondingly filling the processing result into an output log field to obtain a log to be output. The method comprises the steps of configuring a multiplexing description language and analyzing, and calling a log manager of each service module to process acquired log data respectively when the same embedded point is configured in a plurality of service modules, so that a log generated by one embedded point can support a plurality of service scenes.

Description

Log output method and device
Technical Field
The invention relates to the field of computers, in particular to a log output method and a log output device.
Background
With the continuous development of the internet, the internet has entered into the DT (Data Technology) era from the IT (Information Technology) era, and Data has become a raw material for company money-winning. The data includes both the service data of the online service system and the log data generated in the operation process of the service system or realized by some service scenes based on the log form. And the output of the log data needs to be realized by the buried point code written in the service code. It is therefore becoming more and more important to perform logging in a business system.
Existing Log output schemes are basically implemented by open-source Log components, such as Log4j, Log back. The specific implementation process is as follows: writing an embedded point in a service code of a service module, and acquiring log data through the embedded point; and outputting the acquired log data to a local file system through a log component.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
(1) the embedded point needs to be written respectively for each service scene to acquire log data, so that writing of one embedded point cannot be achieved, and the log data can be used in a plurality of service scenes.
(2) The granularity of the log cannot be automatically decomposed, and the log cannot be decomposed into log data used by a plurality of service scenes by writing one embedded point.
(3) The coupling of the log data and the log template is high, and the application is not flexible.
Disclosure of Invention
In view of this, embodiments of the present invention provide a log output method and apparatus, where a multiplexing description language is configured and analyzed, and when the same embedded point is configured in multiple service modules, a log manager of each service module is invoked to process acquired log data, so that a log generated by one embedded point can support multiple service scenarios.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a log output method.
The log output method of the embodiment of the invention comprises the following steps: dividing a service system into one or more service modules according to a service scene, and respectively configuring a multiplexing description language for each service module; the multiplexing description language comprises a log manager identifier, an output log field and a buried point identifier; writing a buried point in a service module to acquire log data; and analyzing the multiplexing description language, calling a log manager configured for each service module to respectively process the log data when the embedded point is configured in a plurality of service modules, and correspondingly filling the processing result into the output log field to obtain the log to be output.
Optionally, the method further comprises: respectively configuring a decomposition description language for each embedded point; the decomposition description language comprises a log splitting type and a log template, and the log splitting type comprises a splitting type and a common type.
Optionally, invoking a log manager configured for each service module to process the log data respectively, and correspondingly filling the processing result into the output log field to obtain a log to be output, including: calling a log manager configured for each service module to analyze the decomposition description language to obtain the log splitting type and a log template; and searching the acquired log data according to the log splitting type and the log template, and correspondingly filling a search result into an output log field of the log template to obtain a log to be output.
Optionally, correspondingly filling the search result into an output log field of the log template, including: when the log split type is a common type, directly and correspondingly filling a search result into an output log field of the log template; and when the log splitting type is the splitting type, the log template comprises a plurality of sub-templates, and the search results are respectively and correspondingly filled in the output log fields of the sub-templates.
Optionally, the method further comprises: and storing the log to be output locally or sending the log to a remote place.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided a log output apparatus.
An apparatus for outputting a log according to an embodiment of the present invention includes: the multiplexing configuration module is used for dividing the service system into one or more service modules according to the service scene and respectively configuring a multiplexing description language for each service module; the multiplexing description language comprises a log manager identifier, an output log field and a buried point identifier; the log acquisition module is used for writing a buried point in the service module to acquire log data; and the analysis calling module is used for analyzing the multiplexing description language, calling a log manager configured for each service module to respectively process the log data when the embedded point is configured in a plurality of service modules, and correspondingly filling the processing result into the output log field to obtain the log to be output.
Optionally, the apparatus further comprises: the decomposition configuration module is used for respectively configuring a decomposition description language for each embedded point; the decomposition description language comprises a log splitting type and a log template, and the log splitting type comprises a splitting type and a common type.
Optionally, the parsing invoking module is further configured to: a log manager configured for each service module is called to analyze the decomposition description language to obtain a log splitting type and a log template; and searching the acquired log data according to the log splitting type and the log template, and correspondingly filling a search result into an output log field of the log template to obtain a log to be output.
Optionally, the parsing invoking module is further configured to: when the log split type is a common type, directly and correspondingly filling a search result into an output log field of the log template; and when the log splitting type is the splitting type, the log template comprises a plurality of sub-templates, and the search results are respectively and correspondingly filled in the output log fields of the sub-templates.
Optionally, the apparatus further comprises: and the log output module is used for storing the log to be output locally or sending the log to a remote place.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement a log output method of an embodiment of the present invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention has stored thereon a computer program that, when executed by a processor, implements a log output method of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: by configuring a multiplexing description language, a service module is selected from service modules of a service system, and a log file required by a plurality of service scenes can be generated by writing a buried point in the selected service module; by configuring the decomposition description language, technicians can automatically decompose log data into log files used by a plurality of service scenes by writing one embedded point; the log data and the log template are decoupled, so that the log template is convenient to modify, and the application is flexible; and a processing method of the custom extended log manager on log data is supported.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a log output method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a multiplexing description language according to an embodiment of the present invention;
FIG. 3 is a flow chart of a log output method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main modules of a log output apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an internal structure of a log output apparatus according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 7 is a schematic diagram of a computer apparatus suitable for use in an electronic device to implement an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of main steps of a log output method according to an embodiment of the present invention. As shown in fig. 1, the log output method of the embodiment of the present invention mainly includes the following steps:
step S101: dividing a service system into one or more service modules according to a service scene, and respectively configuring a multiplexing description language for each service module; the multiplex description language includes a log manager identification, an output log field, and a buried point identification. The business scenario may be understood as a log usage scenario, and common log usage scenarios include an operation log for a user to view, a user log for a research and development staff to view, and a system log. And aiming at the three log use scenes, the service system is divided into three service modules, and each service module corresponds to one log use scene. The multiplexing description language is a kind of specification description for multiplexing the embedded point multi-service scenario, describing to which service scenarios the log data output by the embedded point is applied. The log manager is ultimately responsible for parsing the multiplex description language. The multiplexing description Language is implemented based on an XML (Extensible Markup Language, which is a subset of standard generalized Markup languages, and is a Markup Language for marking electronic documents to make them have structure), and a log manager, a log output field, and a plurality of embedding points are configured for each service module. A buried point may be present in one or more service modules.
Step S102: writing a buried point in the service module to obtain log data. The buried point is a code block written in the service code that implements the log output. In the embodiment of the invention, log data can be obtained by selecting one service module from all service modules of the service system and writing a buried point in the service code of the selected service module.
Step S103: and analyzing the multiplexing description language, calling a log manager configured for each service module to respectively process the log data when the embedded point is configured in a plurality of service modules, and correspondingly filling the processing result into the output log field to obtain the log to be output. The parser parses the configured multiplexing description language and calls a log processor in the log manager to process log data. The treatment process comprises the following steps: for example, log data: step by step, the family education machine is raised, 0.7; a log template: modify keyword bid $ { name } ] modify bid $ { price }; and finally, assembling the log data and the log template into a log: modify keyword bid [ step by step higher home education machine ] bid is modified to 0.7. When the embedded point is configured in a plurality of service modules, the effect achieved by the invention is as follows: for example, the embedded point a is configured in the service module a and the service module B, so that the log data generated by the embedded point a can be used for generating the service scenario a (an operation log for the user to view) corresponding to the service module a and the service scenario B (a user log for the research and development staff to view) corresponding to the service module B.
In addition, the log output method of the embodiment of the invention further comprises the following steps: respectively configuring a decomposition description language for each embedded point; the decomposition description language comprises a log splitting type and a log template, and the log splitting type comprises a splitting type and a common type. The decomposition description language is a language specification defining the granularity decomposition of the log, is implemented based on an XML language, and is mainly used for describing each operation in the system, and the operations comprise an operation type of a buried point, a log splitting type of the buried point, a log template and the like. The operation types of the embedded point comprise a deletion type (Delete) operation, an Update type (Update) operation and an insertion type (Insert) operation, and the operation types support custom extension; the operation type is mainly the identification function, which is convenient for the subsequent induction processing. The log Split types of the buried point include Common type (Common) and Split type (Split). The log template is as follows: and (3) deleting the plan: name of promotion plan
Figure BDA0001356991670000072
Wherein
Figure BDA0001356991670000073
The log data embedded by the embedded point is automatically acquired through the resolver, and the log data is filled into the corresponding deletion plan field and the promotion plan name field.
Table 1 shows the structure of the decomposition description language according to the embodiment of the present invention. As shown in table 1, two scenarios, in which the log splitting type of the embedded point a is the normal type and the log splitting type of the embedded point B is the split type, are described and explained respectively. When the log splitting type is a common type, the resolver searches the name from the log data, the log data corresponding to the id is filled in the template, and the name and the id are names customized by service personnel according to the service scene. When the log splitting type is the splitting type, the log template comprises a plurality of sub-templates (one sub-template outputs one log, as shown in table 1, two sub-templates embedded in the point B can output 2 logs), the parser can correspondingly fill the search result in the output log field of each sub-template, so as to achieve the effect of splitting the acquired log data into a plurality of logs to be output, and the use and meaning of the fields are the same as the interpretation of the common type.
Table 1: structure of decomposition description language of the embodiment of the invention
Figure BDA0001356991670000071
The method for obtaining the log to be output includes the steps of calling log managers configured for all service modules to process the log data respectively, and correspondingly filling a processing result into an output log field to obtain the log to be output: calling a log manager configured for each service module to analyze the decomposition description language to obtain the log splitting type and a log template; and searching the acquired log data according to the log splitting type and the log template, and correspondingly filling a search result into an output log field of the log template to obtain a log to be output.
In addition, the log output method of the embodiment of the invention further comprises the following steps: and storing the log to be output locally or sending the log to a remote place.
Fig. 2 is a schematic structural diagram of a multiplexing description language according to an embodiment of the present invention. As shown in fig. 2, the multiplexing description language according to the embodiment of the present invention includes a plurality of service modules (service module a-service module N), and a log manager identifier, an output log field, and an embedded point identifier are respectively configured for each service module. Such as: the embedded points configured for the service module a include an embedded point a-an embedded point N. Whether the embedded point is configured in a plurality of service modules can be judged by the embedded point identification.
Fig. 3 is a flowchart of a log output method according to an embodiment of the present invention. As shown in fig. 3, the log output method includes:
(1) and respectively configuring a multiplexing description language for each service module, and respectively configuring a decomposition description language for each embedded point in the multiplexing description language (the configuration mode is as described above).
(2) And analyzing the multiplexing description language by an analyzer to obtain a corresponding log processor of the log manager, and analyzing the configured decomposition description language by the log processor to obtain the log splitting type of the embedded point. The log manager includes a log processor and a log outputter.
(3) When the log split type of the embedded point is a common type, the log generated by the embedded point is a common log, and the log processor can pass through the log template according to the log template
Figure BDA0001356991670000081
The paramname searches a value corresponding to the paramname (parameter name) in the log data, and organizes the value into a log template; when the log splitting type of the embedded point is the splitting type, the log generated by the embedded point is the splitting log, and the log processor splits the log data acquired by the embedded point into a plurality of pieces and correspondingly organizes the pieces into each sub-template of the log template.
(4) And outputting the log to be output organized into the log template through a log output device. There are three ways of outputting, one is outputting through a local file (writing the log file to a local disk), and one is outputting through a remote service (transmitting the log file to a remote through a network); yet another is output through a third party open source component (e.g., Log4j, Logback, etc.).
According to the log output method provided by the embodiment of the invention, a business module is selected from business modules of a business system by configuring a multiplexing description language, and a log file required by a plurality of business scenes can be generated by writing a buried point in the selected business module; by configuring the decomposition description language, technicians can automatically decompose log data into log files used by a plurality of service scenes by writing one embedded point; the log data and the log template are decoupled, so that the log template is convenient to modify, and the application is flexible; and a processing method of the custom extended log manager on log data is supported.
Fig. 4 is a schematic diagram of main blocks of a log output apparatus according to an embodiment of the present invention. As shown in fig. 4, thelog output apparatus 400 according to the embodiment of the present invention mainly includes:
amultiplexing configuration module 401, configured to divide the service system into one or more service modules according to the service scenario, and configure a multiplexing description language for each service module; the multiplex description language includes a log manager identification, an output log field, and a buried point identification. The multiplexing description language is a kind of standard description for multiplexing the embedded point multi-service scenario, describing to which service scenarios the log data output by the embedded point is applied, and finally the log manager is responsible for parsing the multiplexing description language. A log manager, a log output field and a plurality of embedded points are configured for each service module through a multiplexing description language.
Alog obtaining module 402, configured to write a buried point in the service module to obtain log data. The log data is obtained by writing a buried point in the service code of the service module.
And ananalysis calling module 403, configured to analyze the multiplexing description language, and when the analysis result indicates that the embedded point is configured in a plurality of service modules, call a log manager configured for each service module to respectively process the log data, and correspondingly fill the processing result in the output log field to obtain a log to be output. The parser parses the configured multiplex description language and invokes a log processor in the log manager to process log data.
Fig. 5 is a schematic diagram of an internal structure of a log output apparatus according to an embodiment of the present invention. As shown in fig. 5, the service system includes a service module a, a log multiplexer, and a log manager; the log multiplexer comprises a multiplexing configuration module and a parser, and the log manager comprises one or two of an abstract log manager, a general log manager and a custom log manager; the abstract log manager, the general log manager and the user-defined log manager respectively comprise a log processor and a log outputter; the log splitting module comprises a decomposition configuration module and a resolver, and the log output device comprises a custom output component and a third-party open source output component. The log output device of the embodiment of the invention comprises the following modules in data processing procedures: writing a buried point in the service code of the service module A to acquire log data. The multiplexing configuration module divides the service system into one or more service modules according to the service scene, and configures multiplexing description language for each service module respectively. And when the embedded point is analyzed to be configured in a plurality of service modules, the log manager configured for each service module is called to respectively process the log data, and the processing result is correspondingly filled in the output log field to obtain the log to be output. The abstract log manager acts as a manager template that defines the overall flow of log processing output. The general log manager and the user-defined log manager only need to realize an abstract method in the abstract log manager based on the polymorphic characteristics of the JAVA language.
The general log manager is used for realizing log output template management, log granularity decomposition and log output and inherits the log from the abstract log manager. A decomposition configuration module of the general log manager respectively configures decomposition description language for each embedded point; the decomposition description language comprises a log splitting type and a log template, and the log splitting type comprises a splitting type and a common type. The parser of the general log manager parses the decomposition description language to obtain a log splitting type and a log template; and searching the acquired log data according to the log splitting type and the log template, and correspondingly filling the search result into the output log field of each log template to obtain the log to be output. When the log split type is a common type, directly organizing the search result to a log template; and when the log splitting type is the splitting type, the log template comprises a plurality of sub templates, and the search result is correspondingly filled in the output log field of each sub template to obtain a plurality of logs to be output. And the log template management module of the universal log manager is used for managing the log module. The Log output device of the general Log manager is used for outputting the processed Log to a storage system for storage, and can be realized through a self-defined output component developed by the general Log manager, and can also be realized by accessing a third-party open source component (such as Log4j, Logback and the like).
The user-defined log manager is used for realizing user-defined processing and bottom layer output of log data and inherits the log data from the abstract log manager. The log may be output by writing a local file, or sending a remote service, or accessing a third party open source component, etc.
It can be seen from the above description that, by configuring the multiplexing description language, a service module is optionally selected from the service modules of the service system, and a log file required by a plurality of service scenarios can be generated by writing a buried point in the selected service module; by configuring the decomposition description language, technicians can automatically decompose log data into log files used by a plurality of service scenes by writing one embedded point; the log data and the log template are decoupled, so that the log template is convenient to modify, and the application is flexible; and a processing method of the custom extended log manager on log data is supported.
Fig. 6 illustrates anexemplary system architecture 600 to which the log output method or log output apparatus of an embodiment of the present invention may be applied.
As shown in fig. 6, thesystem architecture 600 may includeterminal devices 601, 602, 603, anetwork 604, and aserver 605. Thenetwork 604 serves to provide a medium for communication links between theterminal devices 601, 602, 603 and theserver 605.Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use theterminal devices 601, 602, 603 to interact with theserver 605 via thenetwork 604 to receive or send messages or the like. Theterminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
Theterminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
Theserver 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using theterminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the log output method provided by the embodiment of the present application is generally executed by theserver 605, and accordingly, the log output device is generally disposed in theserver 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides an electronic device and a computer readable medium according to the embodiment of the invention.
The electronic device of the present invention includes: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement a log output method of an embodiment of the present invention.
The computer-readable medium of the present invention has stored thereon a computer program which, when executed by a processor, implements a log output method of an embodiment of the present invention.
Referring now to FIG. 7, shown is a block diagram of acomputer system 700 suitable for use with an electronic device implementing an embodiment of the present invention. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, thecomputer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from astorage section 708 into a Random Access Memory (RAM) 703. In theRAM 703, various programs and data necessary for the operation of thecomputer system 700 are also stored. TheCPU 701, theROM 702, and theRAM 703 are connected to each other via abus 704. An input/output (I/O)interface 705 is also connected tobus 704.
The following components are connected to the I/O interface 705: aninput portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; astorage section 708 including a hard disk and the like; and acommunication section 709 including a network interface card such as a LAN card, a modem, or the like. Thecommunication section 709 performs communication processing via a network such as the internet. Adrive 710 is also connected to the I/O interface 705 as needed. Aremovable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on thedrive 710 as necessary, so that a computer program read out therefrom is mounted into thestorage section 708 as necessary.
In particular, the processes described above with respect to the main step diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program containing program code for performing the method illustrated in the main step diagram. In such an embodiment, the computer program can be downloaded and installed from a network through thecommunication section 709, and/or installed from theremovable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a multiplexing configuration module, a log acquisition module, and a resolution call module. The names of the modules do not form a limitation on the modules themselves in some cases, for example, the multiplexing configuration module may also be described as "a module that divides a service system into one or more service modules according to service scenarios and configures a multiplexing description language for each service module".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: dividing a service system into one or more service modules according to a service scene, and respectively configuring a multiplexing description language for each service module; the multiplexing description language comprises a log manager identifier, an output log field and a buried point identifier; writing a buried point in a service module to acquire log data; and analyzing the multiplexing description language, calling a log manager configured for each service module to respectively process the log data when the embedded point is configured in a plurality of service modules, and correspondingly filling the processing result into the output log field to obtain the log to be output.
It can be seen from the above description that, by configuring the multiplexing description language, a service module is optionally selected from the service modules of the service system, and a log file required by a plurality of service scenarios can be generated by writing a buried point in the selected service module; by configuring the decomposition description language, technicians can automatically decompose log data into log files used by a plurality of service scenes by writing one embedded point; the log data and the log template are decoupled, so that the log template is convenient to modify, and the application is flexible; and a processing method of the custom extended log manager on log data is supported.
The product can execute the method provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiment of the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A log output method, comprising:
dividing a service system into a plurality of service modules according to a service scene, and respectively configuring a multiplexing description language for each service module; the multiplexing description language comprises a log manager identifier, an output log field and a buried point identifier;
writing a buried point in a service module to acquire log data;
and analyzing the multiplexing description language, calling a log manager configured for each service module to respectively process the log data when the embedded point is configured in a plurality of service modules, and correspondingly filling the processing result into the output log field to obtain the log to be output.
2. The method of claim 1, further comprising: respectively configuring a decomposition description language for each embedded point; the decomposition description language comprises a log splitting type and a log template, and the log splitting type comprises a splitting type and a common type.
3. The method of claim 2, wherein invoking a log manager configured for each service module to process the log data respectively, and correspondingly filling the processing result into the output log field to obtain a log to be output comprises:
calling a log manager configured for each service module to analyze the decomposition description language to obtain the log splitting type and a log template;
and searching the acquired log data according to the log splitting type and the log template, and correspondingly filling a search result into an output log field of the log template to obtain a log to be output.
4. The method of claim 3, wherein: correspondingly filling the search result into an output log field of the log template, wherein the search result comprises the following steps: when the log split type is a common type, directly and correspondingly filling a search result into an output log field of the log template; and when the log splitting type is the splitting type, the log template comprises a plurality of sub-templates, and the search results are respectively and correspondingly filled in the output log fields of the sub-templates.
5. The method of claim 1, further comprising: and storing the log to be output locally or sending the log to a remote place.
6. A log output apparatus, comprising:
the multiplexing configuration module is used for dividing the service system into a plurality of service modules according to the service scene and respectively configuring a multiplexing description language for each service module; the multiplexing description language comprises a log manager identifier, an output log field and a buried point identifier;
the log acquisition module is used for writing a buried point in the service module to acquire log data;
and the analysis calling module is used for analyzing the multiplexing description language, calling a log manager configured for each service module to respectively process the log data when the embedded point is configured in a plurality of service modules, and correspondingly filling the processing result into the output log field to obtain the log to be output.
7. The apparatus of claim 6, further comprising: the decomposition configuration module is used for respectively configuring a decomposition description language for each embedded point; the decomposition description language comprises a log splitting type and a log template, and the log splitting type comprises a splitting type and a common type.
8. The apparatus of claim 7, wherein the parse call module is further configured to:
a log manager configured for each service module is called to analyze the decomposition description language to obtain a log splitting type and a log template;
and searching the acquired log data according to the log splitting type and the log template, and correspondingly filling a search result into an output log field of the log template to obtain a log to be output.
9. The apparatus of claim 8, wherein: the analysis calling module is further configured to: when the log split type is a common type, directly and correspondingly filling a search result into an output log field of the log template; and when the log splitting type is the splitting type, the log template comprises a plurality of sub-templates, and the search results are respectively and correspondingly filled in the output log fields of the sub-templates.
10. The apparatus of claim 6, further comprising: and the log output module is used for storing the log to be output locally or sending the log to a remote place.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201710600408.6A2017-07-212017-07-21Log output method and deviceActiveCN107491382B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201710600408.6ACN107491382B (en)2017-07-212017-07-21Log output method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201710600408.6ACN107491382B (en)2017-07-212017-07-21Log output method and device

Publications (2)

Publication NumberPublication Date
CN107491382A CN107491382A (en)2017-12-19
CN107491382Btrue CN107491382B (en)2020-11-20

Family

ID=60643495

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201710600408.6AActiveCN107491382B (en)2017-07-212017-07-21Log output method and device

Country Status (1)

CountryLink
CN (1)CN107491382B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109376130A (en)*2018-10-182019-02-22国云科技股份有限公司Method for recording operation log by self-defined template based on multi-cloud platform
CN110795303A (en)*2019-09-252020-02-14北京文渊佳科技有限公司Log output method and device, storage medium and terminal
CN110727646B (en)*2019-10-102021-05-04京东数字科技控股有限公司Format conversion method and device for system log, electronic equipment and computer medium
CN111221702B (en)*2019-11-182024-02-27上海维谛信息科技有限公司Log analysis-based exception handling method, system, terminal and medium
CN113742300B (en)*2020-08-112024-06-18北京沃东天骏信息技术有限公司Log management method, device, server side and system
CN112882900B (en)*2021-02-262022-11-29浪潮通用软件有限公司Method and device for recording service data change log
CN113157659A (en)*2021-05-142021-07-23中国建设银行股份有限公司 A log processing method and device
CN115080150B (en)*2022-07-192024-11-22北京达佳互联信息技术有限公司 Data processing method, device, electronic device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103631699A (en)*2012-08-282014-03-12纽海信息技术(上海)有限公司Log management system and method for log monitoring, acquiring and querying
CN105577454A (en)*2016-03-032016-05-11上海新炬网络信息技术有限公司Method for quickly positioning service fault based on log
CN106571960A (en)*2016-11-032017-04-19北京农信互联科技有限公司Log collection and management system and log collection and management method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103631699A (en)*2012-08-282014-03-12纽海信息技术(上海)有限公司Log management system and method for log monitoring, acquiring and querying
CN105577454A (en)*2016-03-032016-05-11上海新炬网络信息技术有限公司Method for quickly positioning service fault based on log
CN106571960A (en)*2016-11-032017-04-19北京农信互联科技有限公司Log collection and management system and log collection and management method

Also Published As

Publication numberPublication date
CN107491382A (en)2017-12-19

Similar Documents

PublicationPublication DateTitle
CN107491382B (en)Log output method and device
CN107832045B (en)Method and apparatus for cross programming language interface conversion
CN109683998B (en)Internationalization realization method, device and system
CN110471848B (en)Method and device for dynamically returning message
CN113760698B (en) A method and device for converting test case file data
CN112948138B (en) A method and device for processing messages
CN113076294B (en) Information sharing method and device
CN112214500A (en)Data comparison method and device, electronic equipment and storage medium
CN113626223A (en)Interface calling method and device
CN112612467A (en)Method and device for processing micro front-end architecture based on qiankun
CN111381899A (en)Method and apparatus for developing target system
CN112306984A (en) A data source routing method and device
CN111858621A (en)Method, device, equipment and computer readable medium for monitoring business process
CN110705271A (en)System and method for providing natural language processing service
CN112818026A (en)Data integration method and device
CN115328627A (en)Data processing method and device
CN111427899A (en)Method, device, equipment and computer readable medium for storing file
CN109981546B (en)Method and device for acquiring remote call relation between application modules
CN113779122A (en)Method and apparatus for exporting data
CN113312053A (en)Data processing method and device
CN113535221A (en)Method and device for managing application version
CN109901934B (en)Method and device for generating interface help document
CN112835609B (en)Method and device for modifying download address of dependent packet
CN114239530A (en)Method and device for generating chart
CN113760714A (en)Software testing method and device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp