[go: up one dir, main page]

CN107729506A - A kind of storage medium and the other dynamic adjusting method of journal stage, apparatus and system - Google Patents

A kind of storage medium and the other dynamic adjusting method of journal stage, apparatus and system Download PDF

Info

Publication number
CN107729506A
CN107729506A CN201710993717.4A CN201710993717A CN107729506A CN 107729506 A CN107729506 A CN 107729506A CN 201710993717 A CN201710993717 A CN 201710993717A CN 107729506 A CN107729506 A CN 107729506A
Authority
CN
China
Prior art keywords
adjustment
target process
adjustment information
log level
target object
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
CN201710993717.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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710993717.4A priority Critical patent/CN107729506A/en
Publication of CN107729506A publication Critical patent/CN107729506A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/182Distributed file systems
    • 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/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of other dynamic adjusting method of journal stage, applied to distributed file system, including:Obtain the instruction of the other mark and adjustment information for including target process of journal stage of adjustment destination object;Corresponding target process and adjustment information are determined based on instruction, and adjustment information is sent to target process;Adjust the daily record rank of destination object in real time by target process.It can be seen that, due to including the mark and adjustment information of target process in adjusting the other instruction of journal stage of destination object, so, after the other instruction of journal stage of adjustment destination object is got, target process and adjustment information corresponding to being determined based on instruction, then by sending adjustment information to target process so that target process adjusts the daily record rank of destination object according to adjustment information in real time, realizes and the other dynamic of journal stage is adjusted.In addition, the invention also discloses a kind of computer-readable storage medium and a kind of other dynamic adjusting device of journal stage and system, effect is as above.

Description

一种存储介质和日志级别的动态调整方法、装置及系统A method, device and system for dynamically adjusting storage media and log levels

技术领域technical field

本发明涉及计算机领域,特别涉及一种存储介质和日志级别的动态调整方法、装置及系统。The invention relates to the field of computers, in particular to a method, device and system for dynamically adjusting storage media and log levels.

背景技术Background technique

分布式文件系统是指文件系统管理的物理存储资源不一定直接连接在本地节点上,而是通过计算机网络与节点相连。在其应用时,如果发生异常或崩溃,通常需要依靠系统日志来排查问题,这要求系统日志全面,能记录和打印出所有的系统或业务日志。然而,大量的系统日志除了会帮助用户解决问题外,还会造成性能下降,甚至导致系统宕机。A distributed file system means that the physical storage resources managed by the file system are not necessarily directly connected to the local node, but are connected to the node through a computer network. In its application, if an exception or crash occurs, it is usually necessary to rely on the system log to troubleshoot the problem, which requires the system log to be comprehensive and able to record and print out all system or business logs. However, in addition to helping users solve problems, a large number of system logs can also cause performance degradation and even cause system downtime.

目前,分布式文件系统往往是通过在配置文件中设置日志级别,达到调整日志级别的目的。但是,由于配置文件在被系统加载后,无法更改配置文件中的参数,所以,系统的日志级别也就无法被动态调整。而此时,如果日志级别设置较低,则只会有少量日志被打印,当系统出现异常,不利于问题的分析及定位;而如果日志级别设置较高,则会打印大量的日志文件,会对系统性能产生较大影响,甚至导致用户业务中断。At present, the distributed file system often achieves the purpose of adjusting the log level by setting the log level in the configuration file. However, since the parameters in the configuration file cannot be changed after the configuration file is loaded by the system, the log level of the system cannot be dynamically adjusted. At this time, if the log level is set low, only a small amount of logs will be printed, which is not conducive to the analysis and location of the problem when the system is abnormal; and if the log level is set high, a large number of log files will be printed, which will It has a great impact on system performance, and even interrupts user services.

因此,如何实现日志级别的动态调整是本领域技术人员目前需要解决的技术问题。Therefore, how to realize the dynamic adjustment of the log level is a technical problem that those skilled in the art need to solve at present.

发明内容Contents of the invention

本发明的目的是提供一种存储介质和日志级别的动态调整方法、装置及系统,能够实现日志级别的动态调整。The purpose of the present invention is to provide a storage medium and a dynamic adjustment method, device and system of log level, which can realize dynamic adjustment of log level.

为了解决上述技术问题,本发明提供的一种日志级别的动态调整方法,应用于分布式文件系统,包括:In order to solve the above-mentioned technical problems, a dynamic adjustment method of a log level provided by the present invention is applied to a distributed file system, including:

获取调整目标对象的日志级别的指令;Obtain instructions to adjust the log level of the target object;

基于所述指令确定出对应的目标进程和调整信息,并向所述目标进程发送所述调整信息;determining a corresponding target process and adjustment information based on the instruction, and sending the adjustment information to the target process;

通过所述目标进程实时调整所述目标对象的日志级别;adjusting the log level of the target object in real time through the target process;

其中,所述指令中包含有所述目标进程的标志和所述调整信息。Wherein, the instruction includes the flag of the target process and the adjustment information.

优选地,所述向所述目标进程发送所述调整信息具体包括:Preferably, the sending the adjustment information to the target process specifically includes:

预先定义编码规则;pre-defined coding rules;

依据所述编码规则将所述调整信息转化为整型数;converting the adjustment information into an integer number according to the encoding rule;

向所述目标进程发送携带有所述整型数的信号;sending a signal carrying the integer to the target process;

则对应的,所述通过所述目标进程实时调整所述目标对象的日志级别具体包括:Correspondingly, the real-time adjustment of the log level of the target object through the target process specifically includes:

预先定义与所述编码规则对应的解码规则;Defining a decoding rule corresponding to the encoding rule in advance;

利用所述目标进程捕获所述信号,并确定所述信号中携带的所述整型数;using the target process to capture the signal, and determine the integer carried in the signal;

依据所述解码规则解析所述整型数,得到所述调整信息;Analyzing the integer number according to the decoding rule to obtain the adjustment information;

按照所述调整信息实时调整所述目标对象的日志级别。The log level of the target object is adjusted in real time according to the adjustment information.

优选地,所述信号为linux的信号处理机制中的User1信号或User2信号。Preferably, the signal is a User1 signal or a User2 signal in a signal processing mechanism of linux.

优选地,所述调整信息具体包括所述目标对象和调整尺度。Preferably, the adjustment information specifically includes the target object and the adjustment scale.

优选地,在成功调整所述目标对象的日志级别之后,所述动态调整方法还包括:Preferably, after successfully adjusting the log level of the target object, the dynamic adjustment method further includes:

输出所述目标对象的日志级别调整成功的提示信息。Outputting a message indicating that the log level of the target object is successfully adjusted.

优选地,所述提示信息具体包括所述目标对象调整后的日志级别。Preferably, the prompt information specifically includes the adjusted log level of the target object.

为了解决上述技术问题,本发明还提供的一种日志级别的动态调整装置,应用于分布式文件系统,包括:In order to solve the above technical problems, the present invention also provides a dynamic log level adjustment device, which is applied to a distributed file system, including:

获取模块,用于获取调整目标对象的日志级别的指令;An acquisition module, configured to acquire instructions for adjusting the log level of the target object;

发送模块,用于基于所述指令确定出对应的目标进程和调整信息,并向所述目标进程发送所述调整信息;a sending module, configured to determine a corresponding target process and adjustment information based on the instruction, and send the adjustment information to the target process;

调整模块,用于通过所述目标进程实时调整所述目标对象的日志级别;An adjustment module, configured to adjust the log level of the target object in real time through the target process;

其中,所述指令中包含有所述目标进程的标志和所述调整信息。Wherein, the instruction includes the flag of the target process and the adjustment information.

优选地,所述发送模块具体包括:Preferably, the sending module specifically includes:

第一定义单元,用于预先定义编码规则;The first definition unit is used to predefine coding rules;

第一解析单元,用于解析出所述指令中的所述调整信息;a first parsing unit, configured to parse out the adjustment information in the instruction;

转化单元,用于依据所述编码规则将所述调整信息转化为整型数;a conversion unit, configured to convert the adjustment information into an integer number according to the encoding rule;

发送单元,用于向所述目标进程发送携带有所述整型数的信号;a sending unit, configured to send a signal carrying the integer number to the target process;

则对应的,所述调整模块具体包括:Correspondingly, the adjustment module specifically includes:

第二定义单元,用于预先定义与所述编码规则对应的解码规则;A second definition unit, configured to predefine a decoding rule corresponding to the encoding rule;

确定单元,用于利用所述目标进程捕获所述信号,并确定所述信号中携带的所述整型数;a determining unit, configured to use the target process to capture the signal, and determine the integer carried in the signal;

第二解析单元,用于依据所述解码规则解析所述整型数,得到所述调整信息;a second parsing unit, configured to parse the integer according to the decoding rules to obtain the adjustment information;

调整单元,用于按照所述调整信息实时调整所述目标对象的日志级别。An adjustment unit, configured to adjust the log level of the target object in real time according to the adjustment information.

为了解决上述技术问题,本发明还提供的一种日志级别的动态调整系统,包括:In order to solve the above technical problems, the present invention also provides a dynamic adjustment system for log levels, including:

存储器,用于存储动态调整程序;A memory for storing a dynamic adjustment program;

处理器,用于在执行所述动态调整程序时实现如上述任一种动态调整方法的步骤。A processor, configured to implement the steps of any one of the above dynamic adjustment methods when executing the dynamic adjustment program.

为了解决上述技术问题,本发明还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有动态调整程序,所述动态调整程序被处理器执行时实现如如上述任一种动态调整方法的步骤。In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a dynamic adjustment program is stored, and when the dynamic adjustment program is executed by a processor, any one of the above-mentioned The steps of the dynamic adjustment method.

本发明提供的日志级别的动态调整方法,应用于分布式文件系统,包括:获取调整目标对象的日志级别的包含有目标进程的标志和调整信息的指令;基于指令确定出对应的目标进程和调整信息,并向目标进程发送调整信息;通过目标进程实时调整目标对象的日志级别。可见,由于调整目标对象的日志级别的指令中包含有目标进程的标志和调整信息,所以,在获取到调整目标对象的日志级别的指令后,可以基于指令确定出对应的目标进程和调整信息,然后通过向目标进程发送调整信息,使得目标进程能够按照捕获到的调整信息,利用进程自身的动态性实时调整目标对象的日志级别,即实现了对日志级别的动态调整。此外,本发明还提供了一种计算机存储介质和一种日志级别的动态调整装置及系统,效果如上。The method for dynamically adjusting the log level provided by the present invention is applied to a distributed file system, and includes: obtaining an instruction including the logo of the target process and adjustment information for adjusting the log level of the target object; determining the corresponding target process and adjusting the log level based on the instruction information, and send adjustment information to the target process; adjust the log level of the target object in real time through the target process. It can be seen that since the instruction for adjusting the log level of the target object contains the flag and adjustment information of the target process, after obtaining the instruction for adjusting the log level of the target object, the corresponding target process and adjustment information can be determined based on the instruction. Then, by sending adjustment information to the target process, the target process can adjust the log level of the target object in real time according to the captured adjustment information by using the dynamics of the process itself, that is, the dynamic adjustment of the log level is realized. In addition, the present invention also provides a computer storage medium, a log level dynamic adjustment device and system, and the effects are as above.

附图说明Description of drawings

为了更清楚地说明本发明实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。In order to illustrate the embodiments of the present invention more clearly, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. As far as people are concerned, other drawings can also be obtained based on these drawings on the premise of not paying creative work.

图1为本发明实施例提供的一种日志级别的动态调整方法的流程图;FIG. 1 is a flow chart of a method for dynamically adjusting log levels provided by an embodiment of the present invention;

图2为本发明实施例提供的另一种日志级别的动态调整方法的流程图;FIG. 2 is a flow chart of another method for dynamically adjusting log levels provided by an embodiment of the present invention;

图3为本发明实施例提供的一种日志级别的动态调整装置的结构图;FIG. 3 is a structural diagram of an apparatus for dynamically adjusting log levels provided by an embodiment of the present invention;

图4为本发明实施例提供的一种日志级别的动态调整系统的结构图。FIG. 4 is a structural diagram of a system for dynamically adjusting log levels provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有付出创造性劳动的前提下,所获得的所有其他实施例,都属于本发明保护范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本发明的目的是提供一种存储介质和日志级别的动态调整方法、装置及系统,能够实现日志级别的动态调整。The purpose of the present invention is to provide a storage medium and a dynamic adjustment method, device and system of log level, which can realize dynamic adjustment of log level.

为了使本领域的技术人员更好的理解本发明技术方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

图1为本发明实施例提供的一种日志级别的动态调整方法的流程图。如图1所示,本动态调整方法应用于分布式文件系统包括:FIG. 1 is a flowchart of a method for dynamically adjusting log levels provided by an embodiment of the present invention. As shown in Figure 1, the dynamic adjustment method applied to the distributed file system includes:

S10:获取调整目标对象的日志级别的指令。S10: Obtain an instruction for adjusting the log level of the target object.

其中,目标对象是指要调整日志级别的对象,指令中包含有目标进程的标志和调整信息。调整信息至少包括目标对象和调整方案(如将目标对象的日志级别增大或减小、增大或减小多少,将目标对象的日志级别增大或减小到哪一级别等),目标进程是指可以按照调整信息对目标对象进行动态调整的进程,目标进程的标志与目标进程一一对应,即依据目标进程的标志可以唯一确定出一个与该标志对应一个目标进程,如目标进程的标志为目标进程的进程号。Wherein, the target object refers to the object whose log level is to be adjusted, and the instruction includes the mark and adjustment information of the target process. The adjustment information includes at least the target object and the adjustment scheme (such as increasing or decreasing the log level of the target object, how much to increase or decrease, which level to increase or decrease the log level of the target object, etc.), the target process Refers to the process that can dynamically adjust the target object according to the adjustment information. The logo of the target process corresponds to the target process one by one, that is, a target process corresponding to the logo can be uniquely determined according to the logo of the target process, such as the logo of the target process is the process ID of the target process.

S11:基于指令确定出对应的目标进程和调整信息,并向目标进程发送调整信息。S11: Determine a corresponding target process and adjustment information based on the instruction, and send the adjustment information to the target process.

由于指令中包含有目标进程的标志和调整信息,所以获得指令即相当于获得了目标进程的标志和调整信息。具体地,在获得指令之后,可以将指令中包含的目标进程的标志和调整信息确定出来,并在确定出目标进程的标志后,依据目标进程的标志确定与之对应的目标进程,然后向目标进程发送调整信息,以使目标进程获得调整信息,进入步骤S11。Since the instruction includes the flag and adjustment information of the target process, obtaining the instruction is equivalent to obtaining the flag and adjustment information of the target process. Specifically, after obtaining the instruction, the flag and adjustment information of the target process included in the instruction can be determined, and after the flag of the target process is determined, the corresponding target process can be determined according to the flag of the target process, and then the target process can be sent to the target The process sends the adjustment information, so that the target process obtains the adjustment information, and enters step S11.

S12:通过目标进程实时调整目标对象的日志级别。S12: Adjust the log level of the target object in real time through the target process.

目标进程在捕获到调整信息之后,可以利用自身的动态性,按照调整信息实时调整目标对象的日志级别,如将目标对象的日志级别增大至A级,或减小a级等,实现对目标对象的日志级别的动态调整。After the target process captures the adjustment information, it can use its own dynamics to adjust the log level of the target object in real time according to the adjustment information, such as increasing the log level of the target object to A level, or reducing the A level, etc., to achieve the target Dynamic adjustment of the log level of the object.

综上所述,本发明提供的日志级别的动态调整方法,应用于分布式文件系统,由于获取的调整目标对象的日志级别的指令中包含有目标进程的标志和调整信息,所以,在获取到调整目标对象的日志级别的指令后,可以基于指令确定出对应的目标进程和调整信息,然后通过向目标进程发送调整信息,使得目标进程能够按照捕获到的调整信息,利用进程自身的动态性实时调整目标对象的日志级别,即实现对日志级别的动态调整。To sum up, the method for dynamically adjusting the log level provided by the present invention is applied to a distributed file system. Since the obtained instruction for adjusting the log level of the target object contains the target process logo and adjustment information, the obtained After adjusting the log level instruction of the target object, the corresponding target process and adjustment information can be determined based on the instruction, and then by sending the adjustment information to the target process, the target process can use the dynamics of the process itself to real-time according to the captured adjustment information. Adjust the log level of the target object, that is, realize the dynamic adjustment of the log level.

图2为本发明实施例提供的另一种日志级别的动态调整方法的流程图。为了使本动态调整方法更加容易实现,可以通过信号携带调整信息,使得目标进程捕获到信号即相当于捕获到了调整信息,并按照信号携带的调整信息实时调整目标对象的日志级别。因此,本发明的第二个实施例在第一个实施例的基础上作进一步改进,提供另一种日志级别的动态调整方法,如图2所示,包括:FIG. 2 is a flow chart of another method for dynamically adjusting log levels provided by an embodiment of the present invention. In order to make this dynamic adjustment method easier to implement, the adjustment information can be carried by the signal, so that the target process captures the signal, which is equivalent to capturing the adjustment information, and adjusts the log level of the target object in real time according to the adjustment information carried by the signal. Therefore, the second embodiment of the present invention makes further improvements on the basis of the first embodiment, and provides another method for dynamically adjusting the log level, as shown in Figure 2, including:

S10:获取调整目标对象的日志级别的指令。S10: Obtain an instruction for adjusting the log level of the target object.

本实施例的步骤S10与第一个实施例的步骤S10相同,本文不再赘述。Step S10 of this embodiment is the same as step S10 of the first embodiment, and will not be repeated herein.

S20:预先定义编码规则和与编码规则对应的解码规则。S20: Predefine encoding rules and decoding rules corresponding to the encoding rules.

编码规则用于将调整信息转化为便于信号携带的整型数,其中,信号指能够被目标进程捕获到,并能够携带整型数的信号,如Linux的信号处理机制中的用户信号。解码规则用于将整型数转化为调整信息以使目标进程能够按照调整信息实时对目标对象的日志级别进行对应的调整。The encoding rule is used to convert the adjustment information into an integer number that can be easily carried by the signal. The signal refers to a signal that can be captured by the target process and can carry an integer number, such as a user signal in the signal processing mechanism of Linux. The decoding rule is used to convert the integer into adjustment information so that the target process can adjust the log level of the target object in real time according to the adjustment information.

S21:基于指令确定出对应的目标进程和调整信息。S21: Determine the corresponding target process and adjustment information based on the instruction.

步骤S21与步骤S11中的基于指令确定出对应的目标进程和调整信息相同,本文不再赘述。Step S21 is the same as determining the corresponding target process and adjustment information based on the instruction in step S11 , and will not be repeated herein.

S22:依据编码规则将调整信息转化为整型数。S22: Convert the adjustment information into an integer number according to the encoding rule.

S23:向目标进程发送携带有整型数的信号。S23: Send a signal carrying an integer to the target process.

S24:利用目标进程捕获信号,并确定信号中携带的整型数。S24: Use the target process to capture the signal, and determine the integer number carried in the signal.

S25:依据解码规则解析整型数,得到调整信息。S25: Parse the integer according to the decoding rules to obtain adjustment information.

S26:按照调整信息实时调整目标对象的日志级别。S26: Adjust the log level of the target object in real time according to the adjustment information.

目标对象的日志级别的调整结果与调整信息相对应。The adjustment result of the log level of the target object corresponds to the adjustment information.

本实施例提供的动态调整方法,通过信号将调整信息发送至目标进程,使得目标进程能够可靠的捕获到调整信息,并按照调整信息实时对目标对象的日志级别进行对应的调整,在保证了可靠性的前提下,较为简单地实现了对目标对象的日志级别的动态调整。The dynamic adjustment method provided in this embodiment sends the adjustment information to the target process through a signal, so that the target process can reliably capture the adjustment information, and adjust the log level of the target object in real time according to the adjustment information, ensuring reliable On the premise of stability, it is relatively simple to realize the dynamic adjustment of the log level of the target object.

为了使本发明提供的动态调整方法更加便于实现和可靠,可以采用更加成熟和稳定的信号携带调整信息。作为一种优选地实施方式,携带调整信息的信号可以具体为Linux的信号处理机制中的User1信号或User2信号。当然,采用Linux的信号处理机制中的User1信号或User2信号仅为一种优选地实施方式,并不代表只有这一种方式可以实现本实施例,例如还可以采用Linux的信号处理机制中的其它用户信号等携带调整信息,并不影响本实施例的实现。In order to make the dynamic adjustment method provided by the present invention more convenient and reliable, more mature and stable signals can be used to carry adjustment information. As a preferred implementation manner, the signal carrying the adjustment information may specifically be a User1 signal or a User2 signal in a signal processing mechanism of Linux. Of course, using the User1 signal or the User2 signal in the signal processing mechanism of Linux is only a preferred implementation mode, and it does not mean that this embodiment can be realized in only this way. For example, other signals in the signal processing mechanism of Linux can also be used. The user signal and the like carry adjustment information, which does not affect the implementation of this embodiment.

为了在保证调整效果的情况下,使信号携带的调整信息尽量精简,提升调整效率,作为一种优选地实施方式,调整信息具体包括目标对象和调整尺度。当然,为了提升对目标对象的日志级别的调整效果,调整信息还可以包括除目标对象和调整尺度之外的其它信息,本发明不做限定。In order to simplify the adjustment information carried by the signal as much as possible and improve the adjustment efficiency while ensuring the adjustment effect, as a preferred implementation manner, the adjustment information specifically includes the target object and the adjustment scale. Of course, in order to improve the effect of adjusting the log level of the target object, the adjustment information may also include other information except the target object and the adjustment scale, which is not limited in the present invention.

为了提升本动态调整方法的友好性,在成功调整目标对象的日志级别之后,作为一种优选地实施方式,本动态调整方法还还包括:输出目标对象的日志级别调整成功的提示信息。优选地,该提示信息具体包括目标对象调整后的日志级别,如提示信息为“已成功将对象M的日志级别调整为N级”。当然,提示信息还可以包括目标对象的原日志级别,如提示信息为“已成功将对象M的日志级别从S级调整为N级”。可以理解的是,提示信息还可以包括用户可能需要了解的其它信息,本发明不做限定。In order to improve the friendliness of the dynamic adjustment method, after successfully adjusting the log level of the target object, as a preferred implementation manner, the dynamic adjustment method further includes: outputting a prompt message indicating that the log level of the target object is successfully adjusted. Preferably, the prompt information specifically includes the adjusted log level of the target object, for example, the prompt information is "the log level of object M has been successfully adjusted to N level". Certainly, the prompt information may also include the original log level of the target object, for example, the prompt information is "the log level of the object M has been successfully adjusted from S level to N level". It can be understood that the prompt information may also include other information that the user may need to know, which is not limited in the present invention.

上文对于本发明提供的一种日志级别的动态调整方法的实施例进行了详细的描述,本发明还提供了一种与该动态调整方法对应的动态调整装置,由于装置部分的实施例与方法部分的实施例相互照应,因此装置部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。The above has described in detail the embodiment of a log level dynamic adjustment method provided by the present invention, and the present invention also provides a dynamic adjustment device corresponding to the dynamic adjustment method, because the embodiment and method of the device part Part of the embodiments refer to each other, so for the embodiments of the device part, please refer to the description of the embodiments of the method part, and details will not be repeated here.

图3为本发明实施例提供的一种日志级别的动态调整装置的结构图。如图3所示,本动态调整装置应用于分布式文件系统包括:FIG. 3 is a structural diagram of an apparatus for dynamically adjusting log levels provided by an embodiment of the present invention. As shown in Figure 3, the application of the dynamic adjustment device to the distributed file system includes:

获取模块30,用于获取调整目标对象的日志级别的指令。The obtaining module 30 is configured to obtain an instruction for adjusting the log level of the target object.

发送模块31,用于基于指令确定出对应的目标进程和调整信息,并向目标进程发送调整信息。The sending module 31 is configured to determine the corresponding target process and adjustment information based on the instruction, and send the adjustment information to the target process.

调整模块32,用于通过目标进程实时调整目标对象的日志级别。The adjustment module 32 is configured to adjust the log level of the target object in real time through the target process.

其中,指令中包含有目标进程的标志和调整信息。Wherein, the instruction includes the flag and adjustment information of the target process.

作为一种优选地实施方式,发送模块31具体包括:As a preferred implementation manner, the sending module 31 specifically includes:

第一定义单元,用于预先定义编码规则。The first definition unit is used to predefine coding rules.

第一解析单元,用于解析出指令中的调整信息。The first parsing unit is configured to parse out the adjustment information in the instruction.

转化单元,用于依据编码规则将调整信息转化为整型数。The conversion unit is used to convert the adjustment information into an integer number according to the coding rules.

发送单元,用于向目标进程发送携带有整型数的信号。The sending unit is used for sending a signal carrying an integer number to the target process.

则对应的,调整模块32具体包括:Correspondingly, the adjustment module 32 specifically includes:

第二定义单元,用于预先定义与编码规则对应的解码规则。The second definition unit is used to predefine the decoding rules corresponding to the encoding rules.

确定单元,用于利用目标进程捕获信号,并确定信号中携带的整型数。The determining unit is configured to use the target process to capture the signal, and determine the integer number carried in the signal.

第二解析单元,用于依据解码规则解析整型数,得到调整信息。The second parsing unit is used for parsing the integer according to the decoding rules to obtain adjustment information.

调整单元,用于按照调整信息实时调整目标对象的日志级别。The adjustment unit is configured to adjust the log level of the target object in real time according to the adjustment information.

综上所述,本发明提供的动态调整装置,应用于分布式文件系统的日志级别,由于获取模块获取的调整目标对象的日志级别的指令中包含有目标进程的标志和调整信息,所以,在获取模块获取到调整目标对象的日志级别的指令后,可以利用发送模块基于指令确定出对应的目标进程和调整信息,然后通过向目标进程发送调整信息,使得目标进程能够按照捕获到的调整信息,利用进程自身的动态性实时调整目标对象的日志级别,即实现对日志级别的动态调整。To sum up, the dynamic adjustment device provided by the present invention is applied to the log level of the distributed file system. Since the instruction for adjusting the log level of the target object acquired by the acquisition module includes the target process mark and adjustment information, so, in After the obtaining module obtains the instruction to adjust the log level of the target object, the sending module can be used to determine the corresponding target process and adjustment information based on the instruction, and then by sending the adjustment information to the target process, the target process can follow the captured adjustment information, Use the dynamics of the process itself to adjust the log level of the target object in real time, that is, to realize the dynamic adjustment of the log level.

本发明还提供了一种与上述动态调整方法对应的日志级别的动态调整系统,由于系统部分的实施例与方法部分的实施例相互照应,因此系统部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。The present invention also provides a dynamic adjustment system of the log level corresponding to the above dynamic adjustment method. Since the embodiment of the system part and the embodiment of the method part correspond to each other, please refer to the embodiment of the method part for the embodiment of the system part Description, not repeated here.

图4为本发明实施例提供的一种日志级别的动态调整系统的结构图。如图4所示,本动态调整系统包括:FIG. 4 is a structural diagram of a system for dynamically adjusting log levels provided by an embodiment of the present invention. As shown in Figure 4, the dynamic adjustment system includes:

存储器40,用于存储动态调整程序。The memory 40 is used for storing the dynamic adjustment program.

处理器41,用于在执行动态调整程序时实现如上述任一实施例提供的动态调整方法的步骤。The processor 41 is configured to implement the steps of the dynamic adjustment method provided by any one of the above-mentioned embodiments when executing the dynamic adjustment program.

本实施例提供的日志级别的动态调整系统,由于可以通过处理器调用存储器存储的动态调整程序,可以实现上述任一实施例提供的动态调整方法的步骤,所以本系统具有同上述动态调整方法同样的实际效果。The dynamic adjustment system of the log level provided by this embodiment can implement the steps of the dynamic adjustment method provided by any of the above-mentioned embodiments because the processor can call the dynamic adjustment program stored in the memory, so this system has the same functions as the above-mentioned dynamic adjustment method. actual effect.

本发明还提供了一种计算机可读存储介质,计算机可读存储介质上存储有动态调整程序,数据迁移程序被处理器执行时实现如上述任一实施例提供的动态调整方法的步骤。The present invention also provides a computer-readable storage medium, on which a dynamic adjustment program is stored, and when the data migration program is executed by a processor, the steps of the dynamic adjustment method provided in any of the above-mentioned embodiments are implemented.

本实施例提供的计算机可读存储介质,由于动态调整程序被处理器执行时,可以实现上述任一实施例提供的动态调整方法的步骤,所以本计算机可读存储介质具有同上述动态调整方法同样的实际效果。The computer-readable storage medium provided by this embodiment can realize the steps of the dynamic adjustment method provided by any of the above-mentioned embodiments when the dynamic adjustment program is executed by the processor, so the computer-readable storage medium has the same functions as the above-mentioned dynamic adjustment method. actual effect.

以上对本发明所提供的一种存储介质和日志级别的动态调整方法、装置及系统进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明都是与其它实施例的不同之处,各个实施例之间相同相似部分互相参见即可。The method, device and system for dynamically adjusting storage media and log levels provided by the present invention have been described above in detail. Each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.

应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

还需要说明的是,在本说明书中,诸如第一和第二之类的关系术语仅仅用来将一个实体或者操作与另一个实体或者操作区分开来,而不一定要求或者暗示这些实体或者操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何变体意在涵盖非排他性的包含,从而使得包括一系列的要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其它要素,或者还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations Any such actual relationship or order exists between. Furthermore, the terms "comprises", "comprises" or any variations thereof are intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a series of elements includes not only those elements, but also includes elements not expressly listed. other elements of, or also elements inherent in, such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

Claims (10)

1.一种日志级别的动态调整方法,应用于分布式文件系统,其特征在于,包括:1. A dynamic adjustment method of a log level, applied to a distributed file system, is characterized in that, comprising: 获取调整目标对象的日志级别的指令;Obtain instructions to adjust the log level of the target object; 基于所述指令确定出对应的目标进程和调整信息,并向所述目标进程发送所述调整信息;determining a corresponding target process and adjustment information based on the instruction, and sending the adjustment information to the target process; 通过所述目标进程实时调整所述目标对象的日志级别;adjusting the log level of the target object in real time through the target process; 其中,所述指令中包含有所述目标进程的标志和所述调整信息。Wherein, the instruction includes the flag of the target process and the adjustment information. 2.根据权利要求1所述的动态调整方法,其特征在于,所述向所述目标进程发送所述调整信息具体包括:2. The dynamic adjustment method according to claim 1, wherein the sending the adjustment information to the target process specifically comprises: 预先定义编码规则;pre-defined coding rules; 依据所述编码规则将所述调整信息转化为整型数;converting the adjustment information into an integer number according to the encoding rule; 向所述目标进程发送携带有所述整型数的信号;sending a signal carrying the integer to the target process; 则对应的,所述通过所述目标进程实时调整所述目标对象的日志级别具体包括:Correspondingly, the real-time adjustment of the log level of the target object through the target process specifically includes: 预先定义与所述编码规则对应的解码规则;Defining a decoding rule corresponding to the encoding rule in advance; 利用所述目标进程捕获所述信号,并确定所述信号中携带的所述整型数;using the target process to capture the signal, and determine the integer carried in the signal; 依据所述解码规则解析所述整型数,得到所述调整信息;Analyzing the integer number according to the decoding rule to obtain the adjustment information; 按照所述调整信息实时调整所述目标对象的日志级别。The log level of the target object is adjusted in real time according to the adjustment information. 3.根据权利要求2所述的动态调整方法,其特征在于,所述信号为linux的信号处理机制中的User1信号或User2信号。3. The dynamic adjustment method according to claim 2, wherein the signal is a User1 signal or a User2 signal in a signal processing mechanism of linux. 4.根据权利要求1-3任一项所述的动态调整方法,其特征在于,所述调整信息具体包括所述目标对象和调整尺度。4. The dynamic adjustment method according to any one of claims 1-3, wherein the adjustment information specifically includes the target object and an adjustment scale. 5.根据权利要求1-3任一项所述的动态调整方法,其特征在于,在成功调整所述目标对象的日志级别之后,还包括:5. The dynamic adjustment method according to any one of claims 1-3, further comprising: after successfully adjusting the log level of the target object: 输出所述目标对象的日志级别调整成功的提示信息。Outputting a message indicating that the log level of the target object is successfully adjusted. 6.根据权利要求5所述的动态调整方法,其特征在于,所述提示信息具体包括所述目标对象调整后的日志级别。6. The dynamic adjustment method according to claim 5, wherein the prompt information specifically includes the adjusted log level of the target object. 7.一种日志级别的动态调整装置,应用于分布式文件系统,其特征在于,包括:7. A dynamic adjustment device for a log level, applied to a distributed file system, characterized in that it comprises: 获取模块,用于获取调整目标对象的日志级别的指令;An acquisition module, configured to acquire instructions for adjusting the log level of the target object; 发送模块,用于基于所述指令确定出对应的目标进程和调整信息,并向所述目标进程发送所述调整信息;a sending module, configured to determine a corresponding target process and adjustment information based on the instruction, and send the adjustment information to the target process; 调整模块,用于通过所述目标进程实时调整所述目标对象的日志级别;An adjustment module, configured to adjust the log level of the target object in real time through the target process; 其中,所述指令中包含有所述目标进程的标志和所述调整信息。Wherein, the instruction includes the flag of the target process and the adjustment information. 8.根据权利要求7所述的动态调整装置,其特征在于,所述发送模块具体包括:8. The dynamic adjustment device according to claim 7, wherein the sending module specifically comprises: 第一定义单元,用于预先定义编码规则;The first definition unit is used to predefine coding rules; 第一解析单元,用于解析出所述指令中的所述调整信息;a first parsing unit, configured to parse out the adjustment information in the instruction; 转化单元,用于依据所述编码规则将所述调整信息转化为整型数;a conversion unit, configured to convert the adjustment information into an integer number according to the encoding rule; 发送单元,用于向所述目标进程发送携带有所述整型数的信号;a sending unit, configured to send a signal carrying the integer number to the target process; 则对应的,所述调整模块具体包括:Correspondingly, the adjustment module specifically includes: 第二定义单元,用于预先定义与所述编码规则对应的解码规则;A second definition unit, configured to predefine a decoding rule corresponding to the encoding rule; 确定单元,用于利用所述目标进程捕获所述信号,并确定所述信号中携带的所述整型数;a determining unit, configured to use the target process to capture the signal, and determine the integer carried in the signal; 第二解析单元,用于依据所述解码规则解析所述整型数,得到所述调整信息;a second parsing unit, configured to parse the integer according to the decoding rules to obtain the adjustment information; 调整单元,用于按照所述调整信息实时调整所述目标对象的日志级别。An adjustment unit, configured to adjust the log level of the target object in real time according to the adjustment information. 9.一种日志级别的动态调整系统,其特征在于,包括:9. A dynamic adjustment system of log level, characterized in that, comprising: 存储器,用于存储动态调整程序;A memory for storing a dynamic adjustment program; 处理器,用于在执行所述动态调整程序时实现如权利要求1-6任一项所述动态调整方法的步骤。A processor, configured to realize the steps of the dynamic adjustment method according to any one of claims 1-6 when executing the dynamic adjustment program. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有动态调整程序,所述动态调整程序被处理器执行时实现如权利要求1-6任一项所述动态调整方法的步骤。10. A computer-readable storage medium, characterized in that a dynamic adjustment program is stored on the computer-readable storage medium, and when the dynamic adjustment program is executed by a processor, it realizes any one of claims 1-6. The steps of the dynamic adjustment method.
CN201710993717.4A 2017-10-23 2017-10-23 A kind of storage medium and the other dynamic adjusting method of journal stage, apparatus and system Pending CN107729506A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710993717.4A CN107729506A (en) 2017-10-23 2017-10-23 A kind of storage medium and the other dynamic adjusting method of journal stage, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710993717.4A CN107729506A (en) 2017-10-23 2017-10-23 A kind of storage medium and the other dynamic adjusting method of journal stage, apparatus and system

Publications (1)

Publication Number Publication Date
CN107729506A true CN107729506A (en) 2018-02-23

Family

ID=61213319

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710993717.4A Pending CN107729506A (en) 2017-10-23 2017-10-23 A kind of storage medium and the other dynamic adjusting method of journal stage, apparatus and system

Country Status (1)

Country Link
CN (1) CN107729506A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108683520A (en) * 2018-04-08 2018-10-19 烽火通信科技股份有限公司 A kind of filter method and system of stream output
CN108897659A (en) * 2018-06-06 2018-11-27 腾讯音乐娱乐科技(深圳)有限公司 Modify journal stage method for distinguishing, device and storage medium
CN109165147A (en) * 2018-08-10 2019-01-08 北京奇艺世纪科技有限公司 Log print control program, device, system, back-end server and headend equipment
CN109471845A (en) * 2018-10-25 2019-03-15 深圳壹账通智能科技有限公司 Log management method, server, and computer-readable storage medium
CN110058935A (en) * 2019-04-26 2019-07-26 广州华多网络科技有限公司 Log rank method of adjustment, apparatus and system, readable storage medium storing program for executing
CN111182066A (en) * 2019-12-31 2020-05-19 青梧桐有限责任公司 Log level dynamic adjustment method based on token authentication

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050138048A1 (en) * 2003-12-17 2005-06-23 Ki Sung Jin XML database duplicating apparatus for copying XML document to remote server without loss of structure and attribute information of XML document and method thereof
CN1670708A (en) * 2004-03-17 2005-09-21 联想(北京)有限公司 Management method for computer log
US20100306214A1 (en) * 2009-05-28 2010-12-02 Microsoft Corporation Identifying modifiers in web queries over structured data
CN102932176A (en) * 2012-10-29 2013-02-13 深圳市华为技术软件有限公司 Background program log tracking method, tracking side, service side and system
CN105843822A (en) * 2015-01-16 2016-08-10 北京神州泰岳软件股份有限公司 Method and device for changing log levels
CN106502877A (en) * 2016-11-05 2017-03-15 福建省北峰电讯科技有限公司 A kind of log service system of the Virtual terminal of embedded system
CN106681891A (en) * 2015-11-05 2017-05-17 阿里巴巴集团控股有限公司 Method and device for adjusting log level in Java application system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050138048A1 (en) * 2003-12-17 2005-06-23 Ki Sung Jin XML database duplicating apparatus for copying XML document to remote server without loss of structure and attribute information of XML document and method thereof
CN1670708A (en) * 2004-03-17 2005-09-21 联想(北京)有限公司 Management method for computer log
US20100306214A1 (en) * 2009-05-28 2010-12-02 Microsoft Corporation Identifying modifiers in web queries over structured data
CN102932176A (en) * 2012-10-29 2013-02-13 深圳市华为技术软件有限公司 Background program log tracking method, tracking side, service side and system
CN105843822A (en) * 2015-01-16 2016-08-10 北京神州泰岳软件股份有限公司 Method and device for changing log levels
CN106681891A (en) * 2015-11-05 2017-05-17 阿里巴巴集团控股有限公司 Method and device for adjusting log level in Java application system
CN106502877A (en) * 2016-11-05 2017-03-15 福建省北峰电讯科技有限公司 A kind of log service system of the Virtual terminal of embedded system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108683520A (en) * 2018-04-08 2018-10-19 烽火通信科技股份有限公司 A kind of filter method and system of stream output
CN108897659A (en) * 2018-06-06 2018-11-27 腾讯音乐娱乐科技(深圳)有限公司 Modify journal stage method for distinguishing, device and storage medium
CN108897659B (en) * 2018-06-06 2021-10-15 腾讯音乐娱乐科技(深圳)有限公司 Method, device and storage medium for modifying log level
CN109165147A (en) * 2018-08-10 2019-01-08 北京奇艺世纪科技有限公司 Log print control program, device, system, back-end server and headend equipment
CN109471845A (en) * 2018-10-25 2019-03-15 深圳壹账通智能科技有限公司 Log management method, server, and computer-readable storage medium
CN110058935A (en) * 2019-04-26 2019-07-26 广州华多网络科技有限公司 Log rank method of adjustment, apparatus and system, readable storage medium storing program for executing
CN110058935B (en) * 2019-04-26 2022-07-22 广州方硅信息技术有限公司 Log level adjusting method, device and system and readable storage medium
CN111182066A (en) * 2019-12-31 2020-05-19 青梧桐有限责任公司 Log level dynamic adjustment method based on token authentication

Similar Documents

Publication Publication Date Title
CN107729506A (en) A kind of storage medium and the other dynamic adjusting method of journal stage, apparatus and system
CN109688207B (en) Log transmission method and device and server
US9961157B2 (en) Adaptive compression management for web services
CN104580406B (en) A kind of method and apparatus of synchronous logging state
CN106533944B (en) Distributed API gateway, management method and management system
US11201812B2 (en) Virtual probes
CN108182138A (en) Acquisition methods, system, device and the storage medium of BMC SEL daily records
CN106681891A (en) Method and device for adjusting log level in Java application system
CN109274777B (en) A method, device, equipment and readable storage medium for exporting configuration files
CN112636957A (en) Early warning method and device based on log, server and storage medium
CN109005226A (en) The acquisition methods of sensing data, acquisition system and relevant apparatus in server
CN106201783A (en) A kind of data reconstruction method and device
WO2020088170A1 (en) Domain name system configuration method and related apparatus
CN111796958A (en) Transaction anti-hanging method and device under Dubbo frame
CN109165112B (en) Fault recovery method, system and related components of metadata cluster
CN110807009B (en) File processing method and device
CN105262634A (en) Monitoring threshold generation method, device and system
CN109495350B (en) Verification method, device and storage medium of bureau data
CN111698287B (en) Cloud mobile phone active application acquisition method, system and storage medium
CN113220949B (en) Construction method and device of private data identification system
CN113742172B (en) A method, system, and related device for collecting server logs
WO2022028189A1 (en) Screen projection method and apparatus, electronic device, and computer readable storage medium
Nan et al. One solution for voice enabled smart home automation system
CN115914512A (en) Live screenshot method, device, equipment and storage medium
CN105068709B (en) A kind of document handling method and device

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: 20180223

RJ01 Rejection of invention patent application after publication