CN110889068A - Method and device for assisting in consulting log and electronic equipment - Google Patents

Method and device for assisting in consulting log and electronic equipment Download PDF

Info

Publication number
CN110889068A
CN110889068A CN201911012448.4A CN201911012448A CN110889068A CN 110889068 A CN110889068 A CN 110889068A CN 201911012448 A CN201911012448 A CN 201911012448A CN 110889068 A CN110889068 A CN 110889068A
Authority
CN
China
Prior art keywords
log
mail
preset
target
subscription
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.)
Pending
Application number
CN201911012448.4A
Other languages
Chinese (zh)
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.)
Reach Best Technology Co Ltd
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Reach Best 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 Reach Best Technology Co Ltd filed Critical Reach Best Technology Co Ltd
Priority to CN201911012448.4A priority Critical patent/CN110889068A/en
Publication of CN110889068A publication Critical patent/CN110889068A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/107Computer-aided management of electronic mailing [e-mailing]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/42Mailbox-related aspects, e.g. synchronisation of mailboxes

Abstract

The disclosure relates to a method and a device for assisting in consulting logs and electronic equipment, wherein the method comprises the following steps: acquiring at least one log recorded by a target system; generating a log subscription mail based on the at least one log and a preset mail template; and sending the log subscription mail to a mailbox of a log subscriber. The method and the device can enable the log consultant to consult the log in a mode of looking up the log subscription mail without manually logging in the server of the target system, so that the operation of consulting the log of the target system by the log consultant is simplified, and the time and the cost for consulting the log by the subscriber are saved.

Description

Method and device for assisting in consulting log and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for assisting in consulting a log, and an electronic device.
Background
The logs play a significant role in the development or operation and maintenance process of the business system, and developers often need to refer to the logs to locate problems existing in the system.
In the related art, if a developer wants to refer to a log of a service system, the developer needs to log in a server of the service system, call out a log file, and refer the log file by using a designated editor (e.g., a vi/vim editor), which makes the process of referring to the log cumbersome and complicated.
Disclosure of Invention
The disclosure provides a method and a device for assisting in consulting logs and electronic equipment, and aims to at least solve the problems of complex and complicated operation in the process of consulting logs in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a method for assisting in consulting a log, including: acquiring at least one log recorded by a target system; generating a log subscription mail based on the at least one log and a preset mail template; and sending the log subscription mail to a mailbox of a log subscriber.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for assisting in referring to a log, including: a log obtaining unit configured to perform obtaining at least one log recorded by a target system; the mail generating unit is configured to execute log subscription mails based on the at least one log and a preset mail template; and the mail sending unit is configured to execute sending the log subscription mail to a mailbox of a log subscriber.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device that assists in referring to a log, including: a processor, a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of assisting with consulting a journal as described in the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium, wherein instructions that, when executed by a processor of an electronic device for assisting in consulting a journal, enable the electronic device for assisting in consulting the journal to perform the method for assisting in consulting the journal according to the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product, wherein instructions of the computer program product, when executed by a processor of an electronic device assisting in consulting a journal, enable the electronic device assisting in consulting a journal to perform the method assisting in consulting a journal as set forth in the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
because at least one log recorded by the target system can be obtained, and based on the at least one log and the preset mail template, a log subscription mail is generated and sent to a mailbox of a subscriber. Therefore, when a certain developer wants to refer to the log of the target system, the developer can realize the purpose of referring to the log by checking the log subscription mail without manually logging in a server of the target system, so that the operation of referring to the log of the target system by the developer is simplified, and the time and the cost for referring to the log by the subscriber are saved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is one of the flow diagrams illustrating a method of assisting in consulting a journal in accordance with an exemplary embodiment.
FIG. 2 is a second flowchart illustrating a method of assisting in consulting a journal in accordance with an exemplary embodiment.
FIG. 3 is a third flowchart illustrating a method of assisting in consulting a journal in accordance with an exemplary embodiment.
FIG. 4 is a fourth flowchart illustrating a method of assisting in consulting a journal in accordance with an exemplary embodiment.
FIG. 5 is one of the block diagrams illustrating an apparatus to facilitate consulting a journal in accordance with an exemplary embodiment.
FIG. 6 is a second block diagram illustrating an apparatus to assist in consulting a journal in accordance with an exemplary embodiment.
FIG. 7 is a third block diagram illustrating an apparatus that facilitates consulting a journal in accordance with an exemplary embodiment.
FIG. 8 is a block diagram illustrating an electronic device that facilitates consulting a journal in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should be further noted that, the sequence numbers of the steps in the description of the present disclosure do not limit the execution sequence of the steps, and the execution sequence of the steps depends on the inherent logic of the methods provided by the embodiments.
The target system in each technical solution provided by the present disclosure may be a service system developed based on a certain development platform, for example, a node system developed based on a node. The node is a development platform which can enable JavaScript to run on a server, and the JavaScript is an transliteration script language.
As an example, the method and apparatus for assisting in consulting a log according to the embodiments of the present disclosure may be applied to a server of a target system.
FIG. 1 is a flow diagram illustrating a method of assisting in consulting a journal, which may include the following steps, as shown in FIG. 1, in accordance with an exemplary embodiment.
In step S101, at least one log recorded by the target system is acquired.
The target system will keep recording the logs it generates, and in step S101, the at least one log obtained may be a log recorded by the target system within a certain period of time, for example, a log recorded by the target system on a certain day/week/month.
In step S102, a log subscription mail is generated based on the at least one log and a preset mail template.
In the first embodiment, step S102 may include: creating a target mail based on a preset mail template; and writing the at least one log into the target mail to obtain a log subscription mail.
In a second embodiment, step S102 may include: generating a target log file containing the at least one log based on a preset log file format and a preset content format of the log file, and outputting an access link of the target log file; creating a target mail based on the preset mail template; and writing the access link into the target mail to obtain the log subscription mail.
The preset mail template can be obtained by being edited by a subscriber in advance, and is configured in a server of the target system based on a certain configuration mode, the subscriber can be a developer or other personnel of the target system, and the developer comprises a technical member and a non-technical member. Optionally, for different subscribers, the styles of the preset email templates may be different, so as to meet reading habits of different subscribers, improve reading experience of the subscribers, and improve log reading efficiency. It can be understood that, for the non-technical member, subscribing to the mail by the log refers to the log, which is a more friendly log reference method, and in addition, the log subscribed mail is generated based on the customized personalized mail template, so that the log reading experience of the non-technical member can be further improved.
The preset log file format and the preset content format of the log file can also be predefined by a subscriber and configured in a server of the target system based on a certain configuration mode. Optionally, for different subscribers, at least one of the preset log file format and the preset content format of the log file may be different, so as to meet reading habits of the different subscribers, improve reading experience of the subscribers, and improve log reading efficiency. It is easy to understand that for non-technical members, the reading experience of the non-technical members can be improved by the customized personalized log file format and the content format of the log file.
It can be understood that, in step S102, if there is one subscriber, a log subscription email may be generated based on the at least one log and a preset email template configured by the subscriber; if there are multiple subscribers, multiple log subscription mails may also be generated based on the at least one log and multiple preset mail templates configured by the multiple subscribers.
In step S103, the journal subscription mail is sent to a mailbox of a journal subscriber.
As an example, step 103 may specifically include: and when the preset timing time is reached, sending the log subscription mail to a mailbox of a log subscriber. The preset timing time may be a timing trigger time (or period) of the preset timing task, for example, the preset timing time may be 24:00 per day. It can be understood that when the preset timing time is reached, the log in the time period (in the period) is automatically sent to the subscriber through the log subscription mail, so that the situation that the subscriber logs in the server manually to look up the log can be avoided, the operation of the subscriber to look up the log is simplified, and the time and the cost for the subscriber to look up the log are saved.
In the method for assisting in referring to the log provided by this embodiment, because at least one log recorded by the target system may be obtained, based on the at least one log and the preset mail template, a log subscription mail is generated and sent to a mailbox of the subscriber. Therefore, when a certain developer wants to refer to the log of the target system, the developer can realize the purpose of referring to the log by checking the log subscription mail without manually logging in a server of the target system, so that the operation of referring to the log of the target system by the developer is simplified, and the time and the cost for referring to the log by the subscriber are saved.
The method for assisting in viewing the log provided by the present disclosure is explained below by two detailed embodiments shown in fig. 2 and fig. 3.
FIG. 2 is a flow chart illustrating a method of assisting in consulting a journal, as shown in FIG. 2, which may include the following steps, in accordance with another exemplary embodiment.
In step S105, a preset mail template is configured based on the second configuration operation.
As an example, the second configuration operation may be an operation of receiving a character string in a preset form, and after receiving the character string, the preset mail template may be configured based on the character string, where the character string is obtained by converting the preset mail template.
Since the mail is generally rendered through the character string in the html + css form, the character string in the preset form may be the character string in the html + css form. As an example, a mail template previously edited by a subscriber can be converted into a character string in the form of html + css by using a wangditor editor.
Taking a target system as a node system as an example, a character string in the form of html + css can be received through a node mailer module in a node, so as to realize the configuration of a preset mail template.
It can be understood that, through step S105, the user-defined email template can be realized, and the purpose of generating the log subscription email by using different email templates for different subscribers is achieved, so that the reading habits of different subscribers are met, the reading experience of the subscribers is improved, and the log reading efficiency is improved.
In step S101, at least one log recorded by the target system is acquired.
Taking the target system as the node system as an example, the log of the node system at a certain time period may be obtained.
In step S102, the method includes: step S201, a target mail is created based on a preset mail template; step S202, writing the at least one log into the target mail to obtain a log subscription mail.
In step S201, the target mail may be created by the nodemailer module based on the preset mail template, and specifically, the target mail may be created by the nodemailer-smtp-transport module under the nodemailer module. In step S202, the at least one log may be written into the body of the target email, so as to obtain a log subscription email.
It can be understood that the log is directly written into the target email to obtain the log subscription email, so that the log subscriber can more intuitively and quickly see the log after receiving the log subscription email, and the time and cost for consulting the log can be further saved.
In step S103, the journal subscription mail is sent to a mailbox of a journal subscriber.
Taking a target system as a node system as an example, the log subscription email can be sent to the mailbox of the log subscriber by a sendMail method of the transport instances created when the log subscription email is generated by the node mailer-smtp-transport module.
Optionally, a preset timing task may be generated by the node-schedule module, and when the timing time of the preset timing task is reached, the journal subscription email is sent to the mailbox of the journal subscriber. The preset timing time may be a timing trigger time (or period) of the preset timing task, for example, the preset timing time may be 24:00 per day. It can be understood that when the preset timing time is reached, the log in the time period (in the period) is automatically sent to the subscriber through the log subscription mail, so that the situation that the subscriber logs in the server manually to look up the log can be avoided, the operation of the subscriber to look up the log is simplified, and the time and the cost for the subscriber to look up the log are saved.
In the method for assisting in referring to the log provided by this embodiment, because at least one log recorded by the target system may be obtained, based on the at least one log and the preset mail template, a log subscription mail is generated and sent to a mailbox of the subscriber. Therefore, when a certain developer wants to refer to the log of the target system, the developer can realize the purpose of referring to the log by checking the log subscription mail without manually logging in a server of the target system, so that the operation of referring to the log of the target system by the developer is simplified, and the time and the cost for referring to the log by the subscriber are saved.
FIG. 3 is a flow chart illustrating a method of assisting in consulting a journal, as shown in FIG. 3, which may include the following steps, in accordance with another exemplary embodiment.
In step S104, the preset log file format and the preset content format are configured based on a first configuration operation.
Taking the target system as the node system as an example, the first configuration operation may be an operation of calling a configuration method of the node js log4js module, and a preset log file format, a content format of a log file, and the like are specified in the configuration method of the node js log4js module, so that the configuration of the preset log file format and the preset content format is realized by calling the configuration method of the node js log4js module.
As an example, the configure method may specify in the applet that the log is written into a preset file in a preset log file format (e.g., ". log") format; the configure method may specify a preset content format of the log file such as a level of log classification in categories.
In practical application, after the server requests the nodejs LOG4js module for the first time, the server calls the configuration method to configure the nodejs LOG4js module, and if the configuration method is not called, the nodejs LOG4js module calls LOG4JS _ CONFIG to configure, or uses default configuration.
It can be understood that, through step S104, the user-defined format of the log file and the content format of the log file can be realized, and the purpose of generating the log subscription email by using different preset log file formats and preset content formats of the log file for different subscribers is achieved, so that the reading habits of different subscribers are met, the reading experience of the subscribers is improved, and the log reading efficiency is improved.
In step S105, the preset mail template is configured based on the second configuration operation.
As an example, the second configuration operation may be an operation of receiving a character string in a preset form, and after receiving the character string, the preset mail template may be configured based on the character string, where the character string is obtained by converting the preset mail template.
Since the mail is generally rendered through the character string in the html + css form, the character string in the preset form may be the character string in the html + css form. As an example, a mail template previously edited by a subscriber can be converted into a character string in the form of html + css by using a wangditor editor.
Taking a target system as a node system as an example, a character string in the form of html + css can be received through a node mailer module in a node, so as to realize the configuration of a preset mail template.
It can be understood that, through step S105, the user-defined email template can be realized, and the purpose of generating the log subscription email by using different email templates for different subscribers is achieved, so that the reading habits of different subscribers are met, the reading experience of the subscribers is improved, and the log reading efficiency is improved.
In step S101, at least one log recorded by the target system is acquired.
Taking the target system as the node system as an example, the log of the node system at a certain time period may be obtained.
In step S102, the method includes: step S301, generating a target log file containing the at least one log based on a preset log file format and a preset content format of the log file, and outputting an access link of the target log file; step S302, a target mail is created based on a preset mail template; step S303, writing the access link into the target mail to obtain the log subscription mail.
Taking the target system as a node system as an example, in step S301, a target log file including the at least one log may be generated based on a preset log file format and a preset content format of the log file through a node log4js module, and an access link of the target log file is output. In step S302, the target mail may be created by the nodemailer module based on a preset mail template, and specifically, the target mail may be created by the nodemailer-smtp-transport module under the nodemailer module. In step S303, the access link may be written into the title or body of the target email through a nodeb email-smtp-transport module under the nodeb email module, so as to obtain the log subscription email.
It can be understood that the access link of the log file is written into the target mail to obtain the log subscription mail, so that the size of the log subscription mail can be reduced, transmission resources used when the log subscription mail is transmitted are saved, the speed of transmitting the log subscription mail is improved, and a subscriber can receive the log subscription mail more quickly.
In step S103, the journal subscription mail is sent to a mailbox of a journal subscriber.
Taking a target system as a node system as an example, the log subscription email can be sent to the mailbox of the log subscriber by a sendMail method of the transport instances created when the log subscription email is generated by the node mailer-smtp-transport module.
Optionally, a preset timing task may be generated by the node-schedule module, and when the timing time of the preset timing task is reached, the journal subscription email is sent to the mailbox of the journal subscriber. The preset timing time may be a timing trigger time (or period) of the preset timing task, for example, the preset timing time may be 24:00 per day. It can be understood that when the preset timing time is reached, the log in the time period (in the period) is automatically sent to the subscriber through the log subscription mail, so that the situation that the subscriber logs in the server manually to look up the log can be avoided, the operation of the subscriber to look up the log is simplified, and the time and the cost for the subscriber to look up the log are saved.
In the method for assisting in referring to the log provided by this embodiment, because at least one log recorded by the target system may be obtained, based on the at least one log and the preset mail template, a log subscription mail is generated and sent to a mailbox of the subscriber. Therefore, when a certain developer wants to refer to the log of the target system, the developer can realize the purpose of referring to the log by checking the log subscription mail without manually logging in a server of the target system, so that the operation of referring to the log of the target system by the developer is simplified, and the time and the cost for referring to the log by the subscriber are saved.
The following describes a method for consulting a journal assisted by a node according to the present disclosure.
Fig. 4 is a flowchart illustrating a method for node-based assisted review of logs, according to another exemplary embodiment, which may include the following steps, as shown in fig. 4.
In step S401, a configuration configure method of the nodejs log4js module is called, and a preset log file format and a preset content format of the log file are configured.
As an example, the configure method may specify in the applet that the log is written into a preset file in a preset log file format (e.g., ". log") format; the configure method may specify a preset content format of the log file such as a level of log classification in categories.
It can be understood that, through step S401, the user-defined format of the log file and the content format of the log file can be realized, and the purpose of generating the log subscription email by using different preset log file formats and preset content formats of the log file for different subscribers is achieved, so that the reading habits of different subscribers are met, the reading experience of the subscribers is improved, and the log reading efficiency is improved.
In step S402, a predetermined form of a character string is received by the nodemailer module, and a predetermined mail template is configured based on the character string, where the character string is obtained by converting the predetermined mail template.
It can be understood that, through step S402, the mail template can be customized, and the purpose of generating a log subscription mail by using different mail templates for different subscribers is achieved, so that the reading habits of different subscribers are met, the reading experience of the subscribers is improved, and the log reading efficiency is improved.
It should be noted that, in practical applications, if the format of the preset log file, the preset content format of the log file, and the preset mail template are not changed, step S401 and step S402 may be executed once during initialization, and step S401 and step S402 do not need to be executed each time the log subscription mail is generated.
In step S403, at least one log recorded by the node system is acquired.
Specifically, a log of records of the node system in a preset timing period (such as a timing cycle of a preset timing task) may be acquired.
In step S404, a target log file including the at least one log is generated based on a preset log file format and a preset content format of the log file through the nodejs log4js module, and an access link of the target log file is output.
In step S405, a target mail is created based on a preset mail template by a nodemailer module, and the access link is written into the target mail, so as to obtain the log subscription mail.
Specifically, the target mail can be created through a nodemailer-smtp-transport module under the nodemailer module, and the access link is written into the title or the body of the target mail, so that the log subscription mail is obtained.
In step S406, the journal subscription mail is sent to a mailbox of a journal subscriber.
And generating a sendMail method of transport instances created when the log subscribes to the mail through a nodemailer-smtp-transport module, and sending the log subscribing mail to a mailbox of the log subscriber.
Optionally, a preset timing task may be generated by the node-schedule module, and when the timing time of the preset timing task is reached, the log subscription mail is sent to the mailbox of the log subscriber by a sendMail method of a transport instance created when the log subscription mail is generated by the node-smtp-transport module.
In the method for consulting the journal in an auxiliary manner based on the node provided by the embodiment, because at least one journal recorded by a node system can be obtained, a journal subscription mail is generated and sent to a mailbox of a subscriber based on the at least one journal and a preset mail template. Therefore, when a certain developer wants to refer to the journal of the node system, the purpose of referring to the journal can be achieved by looking up the journal subscription mail, the server of the node system does not need to be logged in manually, the operation of referring to the journal of the node system by the developer is simplified, and the time and the cost for the subscriber to refer to the journal are saved.
The subscriber may receive and refer to the log subscription mail through a mailbox client installed in any one of terminal devices such as a smart phone, a Personal Computer (PC), a Pad, and a smart watch.
The above is a description of a method for assisting in consulting a log provided by the present disclosure, and corresponding to the above method embodiment, the present disclosure also provides a device for assisting in consulting a log, which is described below.
FIG. 5 is a block diagram illustrating an apparatus to facilitate viewing logs in accordance with an exemplary embodiment. Referring to fig. 5, the apparatus may include a log obtaining unit 501, a mail generating unit 502, and a mail transmitting unit 503.
A log obtaining unit 501 configured to perform obtaining at least one log recorded by a target system.
A mail generating unit 502 configured to execute generating a log subscription mail based on the at least one log and a preset mail template.
As shown in fig. 6, in one embodiment, the mail generating unit 502 includes a first creating module 601 and a first writing module 602. The first creating module 601 is configured to execute creating a target email based on a preset email template; a first writing module 602 configured to write the at least one log into the target email, so as to obtain a log subscription email.
As shown in fig. 7, in another embodiment, the mail generating unit 502 includes a generating module 701, a second creating module 702, and a second writing module 703. The generating module 701 is configured to execute a preset log file format and a preset content format of a log file, generate a target log file including the at least one log, and output an access link of the target log file; a second creating module 702 configured to create a target mail based on the preset mail template; a second writing module 703 configured to write the access link into the target email, so as to obtain the log subscription email.
A mail sending unit 503 configured to execute sending the journal subscription mail to a mailbox of a journal subscriber.
As an example, the mail sending unit 503 is specifically configured to send the journal subscription mail to a mailbox of a journal subscriber when a preset time is reached.
In the apparatus for assisting in referring to a log provided in this embodiment, because at least one log recorded by a target system may be obtained, a log subscription mail is generated and sent to a mailbox of a subscriber based on the at least one log and a preset mail template. Therefore, when a certain developer wants to refer to the log of the target system, the developer can realize the purpose of referring to the log by checking the log subscription mail without manually logging in a server of the target system, so that the operation of referring to the log of the target system by the developer is simplified, and the time and the cost for referring to the log by the subscriber are saved.
The following describes an apparatus for assisting in viewing a log according to the present disclosure, with two detailed embodiments shown in fig. 6 and fig. 7.
FIG. 6 is a block diagram illustrating an apparatus to facilitate viewing logs in accordance with an exemplary embodiment. Referring to fig. 6, the apparatus may include a second configuration unit 505, a log acquisition unit 501, a mail generation unit 502, and a mail transmission unit 503.
And a second configuration unit 505 configured to perform a configuration of the preset mail template based on the second configuration operation.
As an example, the second configuration operation may be an operation of receiving a character string in a preset form, and after receiving the character string, the preset mail template may be configured based on the character string, where the character string is obtained by converting the preset mail template.
Since the mail is generally rendered through the character string in the html + css form, the character string in the preset form may be the character string in the html + css form. As an example, a mail template previously edited by a subscriber can be converted into a character string in the form of html + css by using a wangditor editor.
It can be understood that, through the steps executed by the second configuration unit 505, the self-definition of the mail template can be realized, and the purpose of generating the log subscription mail by using different mail templates for different subscribers is achieved, so that the reading habits of different subscribers are met, the reading experience of the subscribers is improved, and the log reading efficiency is improved.
A log obtaining unit 501 configured to perform obtaining at least one log recorded by a target system.
The mail generating unit 502 includes: a first creation module 601 and a first writing module 602.
The first creating module 601 is configured to perform creating a target email based on a preset email template. Specifically, the first creating module 601 is configured to create the target mail through the nodemailer module based on a preset mail template, such as creating the target mail through a nodemailer-smtp-transport module under the nodemailer module.
The first writing module 602 is configured to write the at least one log into the target email to obtain a log subscription email. Specifically, the at least one log may be written into the body of the target email to obtain a log subscription email. It can be understood that the log is directly written into the target email to obtain the log subscription email, so that the log subscriber can more intuitively and quickly see the log after receiving the log subscription email, and the time and cost for consulting the log can be further saved.
A mail sending unit 503 configured to execute sending the journal subscription mail to a mailbox of a journal subscriber.
Taking a target system as a node system as an example, the mail sending unit 503 may send the log subscription mail to a mailbox of the log subscriber by using a sendMail method of a transport instance created when the log subscription mail is generated by the node mailer-smtp-transport module.
Optionally, the mail sending unit 503 is configured to generate a preset timing task through the node-schedule module, and send the log subscription mail to a mailbox of a log subscriber when the timing time of the preset timing task is reached.
In the apparatus for assisting in referring to a log provided in this embodiment, because at least one log recorded by a target system may be obtained, a log subscription mail is generated and sent to a mailbox of a subscriber based on the at least one log and a preset mail template. Therefore, when a certain developer wants to refer to the log of the target system, the developer can realize the purpose of referring to the log by checking the log subscription mail without manually logging in a server of the target system, so that the operation of referring to the log of the target system by the developer is simplified, and the time and the cost for referring to the log by the subscriber are saved.
FIG. 7 is a block diagram illustrating an apparatus to facilitate viewing logs in accordance with an exemplary embodiment. Referring to fig. 7, the apparatus may include a first configuration unit 504, a second configuration unit 505, a log acquisition unit 501, a mail generation unit 502, and a mail transmission unit 503.
A first configuration unit 504 configured to perform configuration of the preset log file format and the preset content format based on a first configuration operation.
Taking the target system as the node system as an example, the first configuration operation may be an operation of calling a configuration method of the node js log4js module, and a preset log file format, a content format of a log file, and the like are specified in the configuration method of the node js log4js module, so that the configuration of the preset log file format and the preset content format is realized by calling the configuration method of the node js log4js module.
It can be understood that through the steps executed by the first configuration unit 504, the user-defined log file format and the content format of the log file can be realized, and the purpose of generating the log subscription email by using different preset log file formats and preset content formats of the log file for different subscribers is achieved, so that the reading habits of different subscribers are met, the reading experience of the subscribers is improved, and the log reading efficiency is improved.
And a second configuration unit 505 configured to perform a configuration of the preset mail template based on the second configuration operation.
As an example, the second configuration operation may be an operation of receiving a character string in a preset form, and after receiving the character string, the preset mail template may be configured based on the character string, where the character string is obtained by converting the preset mail template.
Since the mail is generally rendered through the character string in the html + css form, the character string in the preset form may be the character string in the html + css form. As an example, a mail template previously edited by a subscriber can be converted into a character string in the form of html + css by using a wangditor editor.
It can be understood that, through the steps executed by the second configuration unit 505, the self-definition of the mail template can be realized, and the purpose of generating the log subscription mail by using different mail templates for different subscribers is achieved, so that the reading habits of different subscribers are met, the reading experience of the subscribers is improved, and the log reading efficiency is improved.
A log obtaining unit 501 configured to perform obtaining at least one log recorded by a target system.
The mail generating unit 502 includes: a generating module 701, a second creating module 702 and a second writing module 703.
The generating module 701 is configured to execute a preset log file format and a preset content format of the log file, generate a target log file including the at least one log, and output an access link of the target log file.
Wherein, the second creating module 702 is configured to execute creating the target email based on the preset email template.
The second writing module 703 is configured to write the access link into the target email to obtain the log subscription email.
It can be understood that the access link of the log file is written into the target mail to obtain the log subscription mail, so that the size of the log subscription mail can be reduced, transmission resources used when the log subscription mail is transmitted are saved, the speed of transmitting the log subscription mail is improved, and a subscriber can receive the log subscription mail more quickly.
A mail sending unit 503 configured to execute sending the journal subscription mail to a mailbox of a journal subscriber.
Taking a target system as a node system as an example, the mail sending unit 503 may send the log subscription mail to a mailbox of the log subscriber by using a sendMail method of a transport instance created when the log subscription mail is generated by the node mailer-smtp-transport module.
Optionally, the mail sending unit 503 is configured to generate a preset timing task through the node-schedule module, and send the log subscription mail to a mailbox of a log subscriber when the timing time of the preset timing task is reached.
In the apparatus for assisting in referring to a log provided in this embodiment, because at least one log recorded by a target system may be obtained, a log subscription mail is generated and sent to a mailbox of a subscriber based on the at least one log and a preset mail template. Therefore, when a certain developer wants to refer to the log of the target system, the developer can realize the purpose of referring to the log by checking the log subscription mail without manually logging in a server of the target system, so that the operation of referring to the log of the target system by the developer is simplified, and the time and the cost for referring to the log by the subscriber are saved.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 8 is a schematic structural diagram of an electronic device for assisting in consulting a journal according to an embodiment of the present disclosure. Referring to fig. 8, at a hardware level, the electronic device includes a processor, such as a Central Processing Unit (CPU). Optionally, the electronic device further comprises an internal bus 804, a network interface 802, a memory 805, an I/O controller. The Memory may include a Memory, such as a Random-Access Memory (RAM) and a Read-Only Memory (ROM), and may also include a mass storage device 806, such as at least 1 disk storage. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (peripheral component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
A memory to store processor executable instructions. Wherein the processor is configured to execute the instructions stored in the memory, and logically form the auxiliary consulting log device, so as to realize the method for auxiliary consulting log provided by any embodiment of the present disclosure, and achieve the same technical effects.
The method for assisting in consulting a journal disclosed in the embodiment of fig. 1 of the present disclosure may be implemented in or by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in one or more embodiments of the present disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
Of course, besides the software implementation, the electronic device of the present disclosure does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution main body of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
The embodiment of the present disclosure further provides a computer-readable storage medium, where when instructions in the storage medium are executed by a processor of an electronic device for assisting in consulting a journal, the electronic device for assisting in consulting the journal is enabled to perform the method for assisting in consulting the journal provided in any embodiment of the present disclosure, and obtain the same technical effect, where the method includes:
acquiring at least one log recorded by a target system;
generating a log subscription mail based on the at least one log and a preset mail template;
and sending the log subscription mail to a mailbox of a log subscriber.
The embodiment of the present disclosure further provides a computer program product, which includes one or more instructions that can be executed by a processor of a server to complete the steps of the method for assisting in consulting a log provided by the present disclosure and achieve the same technical effect, where the method includes:
acquiring at least one log recorded by a target system;
generating a log subscription mail based on the at least one log and a preset mail template;
and sending the log subscription mail to a mailbox of a log subscriber.
While certain embodiments of the present disclosure have been described above, other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (16)

1. A method for assisting in consulting a journal, comprising:
acquiring at least one log recorded by a target system;
generating a log subscription mail based on the at least one log and a preset mail template;
and sending the log subscription mail to a mailbox of a log subscriber.
2. The method of claim 1, wherein the step of generating a journal subscription mail based on the at least one journal and a predetermined mail template comprises:
creating a target mail based on a preset mail template;
and writing the at least one log into the target mail to obtain a log subscription mail.
3. The method of claim 1, wherein the step of generating a journal subscription mail based on the at least one journal and a predetermined mail template comprises:
generating a target log file containing the at least one log based on a preset log file format and a preset content format of the log file, and outputting an access link of the target log file;
creating a target mail based on the preset mail template;
and writing the access link into the target mail to obtain the log subscription mail.
4. The method of assisting in referring to logs of claim 3, wherein before the step of generating the target log file containing the at least one log based on the preset log file format and the preset content format of the log file, the method further comprises:
and configuring the preset log file format and the preset content format based on a first configuration operation.
5. The method of claim 3, wherein the target system is a node system, and wherein the step of generating the target log file including the at least one log based on a preset log file format and a preset content format of the log file comprises:
and generating a target log file containing the at least one log based on a preset log file format and a preset content format of the log file through a nodejs log4js module.
6. A method for assisting in consulting a journal as in any of claims 2-5, wherein prior to said step of creating a target mail based on said predetermined mail template, further comprising:
and configuring the preset mail template based on a second configuration operation.
7. The method for assisting in referring to the log as claimed in any one of claims 2 to 5, wherein the target system is a node system, and wherein the step of creating the target mail based on the preset mail template comprises:
and creating the target mail based on the preset mail template through the nodemailer module.
8. The method for assisting in referring to the journal, according to any of claims 1-5, wherein said step of sending the journal subscription mail to a mailbox of a journal subscriber comprises:
and when the preset timing time is reached, sending the log subscription mail to a mailbox of a log subscriber.
9. An apparatus for assisting in consulting a journal, comprising:
a log obtaining unit configured to perform obtaining at least one log recorded by a target system;
the mail generating unit is configured to execute log subscription mails based on the at least one log and a preset mail template;
and the mail sending unit is configured to execute sending the log subscription mail to a mailbox of a log subscriber.
10. An apparatus for assisting in referring to a log as claimed in claim 9,
the mail generating unit includes:
a first creation module configured to perform creation of a target mail based on a preset mail template;
and the first writing module is configured to write the at least one log into the target mail to obtain a log subscription mail.
11. An apparatus for assisting in referring to a log as claimed in claim 9,
the mail generating unit includes:
the generating module is configured to execute a preset content format based on a preset log file format and a log file, generate a target log file containing the at least one log, and output an access link of the target log file;
the second creating module is configured to create a target mail based on the preset mail template;
and the second writing module is configured to write the access link into the target mail to obtain the log subscription mail.
12. An apparatus for assisting in reviewing a log as recited in claim 11, further comprising:
a first configuration unit configured to perform a first configuration operation based on a target log file including the at least one log before performing the preset content format based on the preset log file format and the log file to generate the preset log file format and the preset content format.
13. An apparatus for assisting in reviewing a log as recited in any one of claims 10-12, further comprising:
and the second configuration unit is configured to execute second configuration operation to configure the preset mail template before executing the creation of the target mail based on the preset mail template.
14. An apparatus for assisting with referring to a log according to any one of claims 9 to 12,
the mail sending unit is configured to send the log subscription mail to a mailbox of a log subscriber when a preset timing time is reached.
15. An electronic device that facilitates consulting a journal, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a method of assisting a review log as claimed in any of claims 1 to 8.
16. A storage medium having instructions stored thereon that, when executed by a processor of an electronic device for assisting with consulting a journal, enable the electronic device for assisting with consulting a journal to perform a method of assisting with consulting a journal as claimed in any one of claims 1 to 8.
CN201911012448.4A 2019-10-23 2019-10-23 Method and device for assisting in consulting log and electronic equipment Pending CN110889068A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911012448.4A CN110889068A (en) 2019-10-23 2019-10-23 Method and device for assisting in consulting log and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911012448.4A CN110889068A (en) 2019-10-23 2019-10-23 Method and device for assisting in consulting log and electronic equipment

Publications (1)

Publication Number Publication Date
CN110889068A true CN110889068A (en) 2020-03-17

Family

ID=69746407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911012448.4A Pending CN110889068A (en) 2019-10-23 2019-10-23 Method and device for assisting in consulting log and electronic equipment

Country Status (1)

Country Link
CN (1) CN110889068A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075051A1 (en) * 2004-09-20 2006-04-06 Microsoft Corporation Topology for journaling e-mail messages and journaling e-mail messages for policy compliance
CN101815010A (en) * 2009-02-25 2010-08-25 北京启明星辰信息技术股份有限公司 Method and system for reporting system logs
CN108574620A (en) * 2017-03-09 2018-09-25 腾讯科技(深圳)有限公司 A kind of data subscription method, device, server and system
CN109542733A (en) * 2018-12-05 2019-03-29 焦点科技股份有限公司 A kind of highly reliable real-time logs collection and visual m odeling technique method
CN109800223A (en) * 2018-12-12 2019-05-24 平安科技(深圳)有限公司 Log processing method, device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075051A1 (en) * 2004-09-20 2006-04-06 Microsoft Corporation Topology for journaling e-mail messages and journaling e-mail messages for policy compliance
CN101815010A (en) * 2009-02-25 2010-08-25 北京启明星辰信息技术股份有限公司 Method and system for reporting system logs
CN108574620A (en) * 2017-03-09 2018-09-25 腾讯科技(深圳)有限公司 A kind of data subscription method, device, server and system
CN109542733A (en) * 2018-12-05 2019-03-29 焦点科技股份有限公司 A kind of highly reliable real-time logs collection and visual m odeling technique method
CN109800223A (en) * 2018-12-12 2019-05-24 平安科技(深圳)有限公司 Log processing method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10705942B1 (en) Simulated testing of API
US20050240620A1 (en) Arrangement for controlling and logging voice enabled web applications using extensible markup language documents
CN108280023B (en) Task execution method and device and server
CN111597110B (en) Page test method and device, electronic equipment and storage medium
CN110457038B (en) Card display method, device and equipment of auxiliary application terminal and storage medium
CN109344066B (en) Method, system and terminal for testing browser page
CN111858376A (en) Request message generation method and interface test method
CN110610376A (en) Behavior data response method and device, computer equipment and storage medium
CN111897738A (en) Automatic testing method and device based on atomic service
CN111444453A (en) Page return data processing method and device
CN113885745A (en) Visual flow chart arranging method and device, readable medium and computer equipment
CN116112457A (en) Method, device, computer equipment and storage medium for notifying message
CN110889068A (en) Method and device for assisting in consulting log and electronic equipment
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
CN111881025B (en) Automatic test task scheduling method, device and system
CN111143526B (en) Method and device for generating and controlling configuration information of counsel service control
CN107943539B (en) Application page starting method and application page starting device
CN111401020A (en) Interface loading method and system and computing equipment
CN117234512B (en) Method, system, electronic equipment and storage medium for rapidly developing business
CN111026466A (en) File processing method and device, computer readable storage medium and electronic equipment
CN115242764B (en) Multi-terminal communication method, system, equipment and storage medium for front end
CN112306324B (en) Information processing method, apparatus, device and medium
CN116528178B (en) Traffic packet service processing system, method, device and readable storage medium
CN113342447B (en) Page generation method, device, equipment and storage medium based on Flutter
CN116010266A (en) Data processing method, device, terminal equipment and medium for webpage test

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200317

RJ01 Rejection of invention patent application after publication