CN112486435B - Method, system and device for log printing - Google Patents
Method, system and device for log printing Download PDFInfo
- Publication number
- CN112486435B CN112486435B CN202011501427.1A CN202011501427A CN112486435B CN 112486435 B CN112486435 B CN 112486435B CN 202011501427 A CN202011501427 A CN 202011501427A CN 112486435 B CN112486435 B CN 112486435B
- Authority
- CN
- China
- Prior art keywords
- log
- server
- monitoring terminal
- printing
- log level
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1211—Improving printing performance
- G06F3/1212—Improving printing performance achieving reduced delay between job submission and print start
- G06F3/1214—Improving printing performance achieving reduced delay between job submission and print start at the submitting node
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1218—Reducing or saving of used resources, e.g. avoiding waste of consumables or improving usage of hardware resources
- G06F3/122—Reducing or saving of used resources, e.g. avoiding waste of consumables or improving usage of hardware resources with regard to computing resources, e.g. memory, CPU
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1224—Client or server resources management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1273—Print job history, e.g. logging, accounting, tracking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1278—Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
- G06F3/1285—Remote printer device, e.g. being remote from client or server
- G06F3/1288—Remote printer device, e.g. being remote from client or server in client-server-printer device configuration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1296—Printer job scheduling or printer resource handling
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
- Accessory Devices And Overall Control Thereof (AREA)
Abstract
本申请涉及计算机技术领域,公开一种用于日志打印的方法,包括:第一服务端发送监控指令至监控端;根据监控端返回的信息确定需要进行日志级别调整的目标服务器,监控端返回的信息至少包括目标服务器的标识信息和目标服务器的日志级别调整信息;根据日志级别调整信息调整目标服务器的日志级别;响应于客户端提交的日志打印服务请求,启动日志打印服务。这样,可以在调整日志级别时减轻服务器负载压力,减小请求耗时;同时,扩大日志打印的范围,方便线上问题溯源。本申请还公开一种用于日志打印的系统和装置。
This application relates to the field of computer technology, and discloses a method for printing logs, including: the first server sends a monitoring command to the monitoring end; determines the target server that needs to adjust the log level according to the information returned by the monitoring end; The information includes at least identification information of the target server and log level adjustment information of the target server; the log level of the target server is adjusted according to the log level adjustment information; and the log printing service is started in response to the log printing service request submitted by the client. In this way, the server load pressure can be reduced when adjusting the log level, and the time-consuming request can be reduced; at the same time, the scope of log printing can be expanded to facilitate online problem tracing. The application also discloses a system and device for log printing.
Description
技术领域technical field
本申请涉及计算机技术领域,具体涉及一种用于日志打印的方法、系统和装置。The present application relates to the field of computer technology, in particular to a method, system and device for printing logs.
背景技术Background technique
目前,为了降低请求耗时和服务器压力,项目上线后通常都会通过log4j(log forjava,java日志)将项目的日志级别更改为ERROR(错误),因此更改后仅能启动或打印ERROR级别的日志。当线上出现问题时,仅通过该级别的日志可能无法对问题精确溯源,还需要通过调整日志级别扩大可启动或可打印的日志的范围。At present, in order to reduce request time-consuming and server pressure, after the project goes online, the log level of the project is usually changed to ERROR (error) through log4j (log forjava, java log), so after the change, only ERROR-level logs can be started or printed. When a problem occurs online, it may not be possible to accurately trace the source of the problem only through logs of this level, and it is also necessary to expand the range of logs that can be started or printed by adjusting the log level.
但是,调整日志级别会加重服务器的压力,增大请求耗时,并且部分日志级别调整后需要重启服务才能生效,风险较高。此外,如果在分布式系统中调整日志级别,还需要针对各个服务器节点调用接口,操作不方便。However, adjusting the log level will increase the pressure on the server and increase the time-consuming of the request, and after some log level adjustments, the service needs to be restarted to take effect, which is a high risk. In addition, if you adjust the log level in a distributed system, you also need to call the interface for each server node, which is inconvenient to operate.
发明内容Contents of the invention
本公开实施例提供了一种用于日志打印的方法、系统和装置,以保证减轻服务器负载压力,减小请求耗时的同时,较好地解决问题溯源困难的问题。Embodiments of the present disclosure provide a method, system, and device for log printing, so as to reduce the load pressure on the server, reduce the time-consuming request, and better solve the problem of difficulty in tracing the source of the problem.
在一些实施例中,所述用于日志打印的方法包括:第一服务端发送监控指令至监控端;根据监控端返回的信息确定需要进行日志级别调整的目标服务器,监控端返回的信息至少包括目标服务器的标识信息和目标服务器的日志级别调整信息;根据日志级别调整信息调整目标服务器的日志级别;响应于客户端提交的日志打印服务请求,启动日志打印服务。In some embodiments, the method for log printing includes: the first server sends a monitoring instruction to the monitoring terminal; and determines the target server that needs to adjust the log level according to the information returned by the monitoring terminal, and the information returned by the monitoring terminal includes at least The identification information of the target server and the log level adjustment information of the target server; the log level of the target server is adjusted according to the log level adjustment information; and the log printing service is started in response to the log printing service request submitted by the client.
在一些实施例中,所述响应于客户端提交的日志打印服务请求,启动日志打印服务,包括:根据调整后的目标服务器的日志级别,确定打印权限和打印标识信息;如果打印权限表示需要验证打印标识信息,则在打印标识信息验证成功的情况下,启动日志打印服务。In some embodiments, the starting of the log printing service in response to the log printing service request submitted by the client includes: determining the print permission and print identification information according to the adjusted log level of the target server; if the print permission indicates that verification is required If the identification information is printed, the log printing service is started when the verification of the printed identification information is successful.
在一些实施例中,验证打印标识信息,具体包括:获得客户端提交的打印标识信息;根据客户端提交的打印标识信息和预存打印标识信息,获得打印标识信息验证结果。In some embodiments, verifying the print identification information specifically includes: obtaining the print identification information submitted by the client; and obtaining a verification result of the print identification information according to the print identification information submitted by the client and the pre-stored print identification information.
在一些实施例中,所述启动日志打印服务后,还包括:清理预存打印标识信息,并关闭日志打印服务。In some embodiments, after starting the log printing service, it further includes: clearing the pre-stored printing identification information, and closing the log printing service.
在一些实施例中,所述用于日志打印的方法包括:监控端获得第二服务端发送的日志级别调整指令,日志级别调整指令由客户端关联的用户提交至第二服务端,且日志级别调整指令包括待调整的目标服务器的标识信息以及所述目标服务器的日志级别调整信息;响应于第一服务端发送的监控指令,将所述日志级别调整指令提交至所述第一服务端,以便第一服务端根据所述日志级别调整信息调整所述目标服务器的日志级别,并根据调整后的日志级别提供日志打印服务。In some embodiments, the method for log printing includes: the monitoring terminal obtains the log level adjustment instruction sent by the second server end, the log level adjustment instruction is submitted by the user associated with the client to the second server end, and the log level The adjustment instruction includes the identification information of the target server to be adjusted and the log level adjustment information of the target server; in response to the monitoring instruction sent by the first server, submit the log level adjustment instruction to the first server, so that The first server adjusts the log level of the target server according to the log level adjustment information, and provides log printing service according to the adjusted log level.
在一些实施例中,所述用于日志打印的方法包括:第二服务端获得客户端关联的用户输入的日志级别调整指令,日志级别调整指令包括待调整的目标服务器的标识信息以及所述目标服务器的日志级别调整信息;将日志级别调整指令发送至监控端,以便监控端在获得第一服务端发送的监控指令时,将日志级别调整指令发送至第一服务端,由第一服务端根据日志级别调整信息调整目标服务器的日志级别,并根据调整后的日志级别提供日志打印服务。In some embodiments, the method for log printing includes: the second server obtains a log level adjustment instruction input by a user associated with the client, and the log level adjustment instruction includes the identification information of the target server to be adjusted and the target The log level adjustment information of the server; the log level adjustment instruction is sent to the monitoring terminal, so that when the monitoring terminal obtains the monitoring instruction sent by the first server end, the log level adjustment instruction is sent to the first server end, and the first server end according to The log level adjustment information adjusts the log level of the target server, and provides log printing service according to the adjusted log level.
在一些实施例中,所述用于日志打印的系统包括:第一服务端、监控端、第二服务端以及客户端;第一服务端用于发送监控指令至监控端;并根据监控端返回的信息确定需要进行日志级别调整的目标服务器以及目标服务器的日志级别调整信息;根据日志级别调整信息调整目标服务器的日志级别,并在获得客户端提交的日志打印服务请求时,启动日志打印服务;监控端用于获得第二服务端发送的日志级别调整指令,日志级别调整指令由客户端关联的用户提交至第二服务端,且日志级别调整指令包括目标服务器的标识信息以及目标服务器的日志级别调整信息。In some embodiments, the system for log printing includes: a first server, a monitoring terminal, a second server, and a client; the first server is used to send monitoring instructions to the monitoring terminal; and returns according to the monitoring terminal The information determines the target server that needs to be adjusted to the log level and the log level adjustment information of the target server; adjusts the log level of the target server according to the log level adjustment information, and starts the log printing service when the log printing service request submitted by the client is obtained; The monitoring terminal is used to obtain the log level adjustment instruction sent by the second server, the log level adjustment instruction is submitted to the second server by the user associated with the client, and the log level adjustment instruction includes the identification information of the target server and the log level of the target server Adjustment information.
在一些实施例中,所述用于日志打印的装置包括处理器和存储有程序指令的存储器。该处理器被配置为在执行程序指令时,执行上述用于日志打印的方法。In some embodiments, the apparatus for journal printing includes a processor and a memory storing program instructions. The processor is configured to execute the above method for log printing when executing the program instructions.
本公开实施例提供的用于日志打印的方法、系统和装置,可以实现以下技术效果:The method, system and device for log printing provided by the embodiments of the present disclosure can achieve the following technical effects:
第一服务端发送监控指令至监控端,以便第一服务器根据监控端返回的信息,确定需要进行日志级别调整的目标服务器,并根据监控端返回的目标服务器的日志级别调整信息动态调整目标服务器的日志级别,如此方案,可以在调整日志级别时减轻服务器负载压力,减小请求耗时。完成日志级别调整后,第一服务端还可响应客户端提交的日志打印服务请求,启动日志打印服务,这样可以在保证减轻服务器负载压力,减小请求耗时的同时,扩大日志打印的范围,解决在线上出现问题时,仅能打印部分日志级别对应的日志,不好对线上进行问题溯源的问题。The first server sends a monitoring instruction to the monitoring terminal, so that the first server determines the target server that needs to adjust the log level according to the information returned by the monitoring terminal, and dynamically adjusts the log level of the target server according to the log level adjustment information of the target server returned by the monitoring terminal. The log level, such a solution, can reduce the server load pressure and reduce the request time when adjusting the log level. After the log level adjustment is completed, the first server can also respond to the log printing service request submitted by the client and start the log printing service, which can reduce the load pressure on the server and reduce the time-consuming request while expanding the scope of log printing. Solve the problem that when a problem occurs online, only some logs corresponding to the log level can be printed, and it is difficult to trace the source of the problem online.
以上的总体描述和下文中的描述仅是示例性和解释性的,不用于限制本申请。The foregoing general description and the following description are exemplary and explanatory only and are not intended to limit the application.
附图说明Description of drawings
一个或多个实施例通过与之对应的附图进行示例性说明,这些示例性说明和附图并不构成对实施例的限定,附图中具有相同参考数字标号的元件示为类似的元件,附图不构成比例限制,并且其中:One or more embodiments are exemplified by the corresponding drawings, and these exemplifications and drawings do not constitute a limitation to the embodiments, and elements with the same reference numerals in the drawings are shown as similar elements, The drawings are not limited to scale and in which:
图1是本公开实施例提供的一个用于日志打印的方法的示意图;Fig. 1 is a schematic diagram of a method for log printing provided by an embodiment of the present disclosure;
图2是本公开实施例提供的另一个用于日志打印的方法的示意图;Fig. 2 is a schematic diagram of another method for log printing provided by an embodiment of the present disclosure;
图3是本公开实施例提供的另一个用于日志打印的方法的示意图;Fig. 3 is a schematic diagram of another method for log printing provided by an embodiment of the present disclosure;
图4是本公开实施例提供的另一个用于日志打印的方法的示意图;Fig. 4 is a schematic diagram of another method for log printing provided by an embodiment of the present disclosure;
图5是本公开实施例提供的一个用于日志打印装置的示意图。Fig. 5 is a schematic diagram of a log printing device provided by an embodiment of the present disclosure.
附图标记reference sign
100:处理器;101:存储器;102:通信接口;总线:103100: processor; 101: memory; 102: communication interface; bus: 103
具体实施方式Detailed ways
为了能够更加详尽地了解本公开实施例的特点与技术内容,下面结合附图对本公开实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本公开实施例。在以下的技术描述中,为方便解释起见,通过多个细节以提供对所披露实施例的充分理解。然而,在没有这些细节的情况下,一个或多个实施例仍然可以实施。在其它情况下,为简化附图,熟知的结构和装置可以简化展示。In order to understand the characteristics and technical content of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure will be described in detail below in conjunction with the accompanying drawings. The attached drawings are only for reference and description, and are not intended to limit the embodiments of the present disclosure. In the following technical description, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown simplified in order to simplify the drawings.
本公开实施例的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开实施例的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含。The terms "first", "second" and the like in the description and claims of the embodiments of the present disclosure and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It should be understood that the data so used may be interchanged under appropriate circumstances so as to facilitate the embodiments of the disclosed embodiments described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion.
除非另有说明,术语“多个”表示两个或两个以上。Unless stated otherwise, the term "plurality" means two or more.
本公开实施例中,字符“/”表示前后对象是一种“或”的关系。例如,A/B表示:A或B。In the embodiments of the present disclosure, the character "/" indicates that the preceding and following objects are an "or" relationship. For example, A/B means: A or B.
术语“和/或”是一种描述对象的关联关系,表示可以存在三种关系。例如,A和/或B,表示:A或B,或,A和B这三种关系。The term "and/or" is an associative relationship describing objects, indicating that there can be three relationships. For example, A and/or B means: A or B, or, A and B, these three relationships.
本公开实施例提供一种用于日志打印的系统,可以包括第一服务端、监控端、第二服务端和客户端。作为一种示例,客户端可以部署于开发人员关联的终端,第一服务端、第二服务端以及监控端均可以部署于云端服务器,可以理解地,在实际应用过程中,三者可以部署在同一台云端服务器上,或者,可以部署在不同云端服务器上,本公开实施例对此可不做具体限定。以上四者相互配合,通过本实施例提供的方案,可以解决调整日志级别的时候服务器负载压力大且请求耗时长的问题。An embodiment of the present disclosure provides a system for printing logs, which may include a first server end, a monitoring end, a second server end, and a client end. As an example, the client can be deployed on the terminal associated with the developer, and the first server, the second server, and the monitoring terminal can all be deployed on the cloud server. Understandably, in the actual application process, the three can be deployed on It may be deployed on the same cloud server, or may be deployed on different cloud servers, which is not specifically limited in this embodiment of the present disclosure. The above four cooperate with each other, and through the solution provided by this embodiment, the problems of heavy load on the server and long time-consuming requests can be solved when adjusting the log level.
在实际应用过程中,如果用户,即上文所说的开发人员确定目标服务器不具有打印权限时,则可以将至少包括目标服务器的标识信息及其日志级别调整信息的日志调整指令输入第二服务端,以便第二服务端获得该日志级别调整指令,发送至监控端。对应地,监控端响应于第一服务端发送的监控指令,将该日志级别调整指令发送至第一服务端,以便第一服务端根据该日志级别调整信息,调整目标服务器的日志级别,从而实现在客户端提交日志打印服务请求的时候,启动日志打印服务。具体实现过程可参见下文所作介绍。In the actual application process, if the user, that is, the developer mentioned above, determines that the target server does not have printing authority, he can input the log adjustment instruction including at least the identification information of the target server and its log level adjustment information into the second service terminal, so that the second server terminal can obtain the log level adjustment instruction and send it to the monitoring terminal. Correspondingly, the monitoring terminal sends the log level adjustment command to the first server in response to the monitoring command sent by the first server, so that the first server adjusts the log level of the target server according to the log level adjustment information, thereby realizing When the client submits a log printing service request, start the log printing service. For the specific implementation process, please refer to the introduction below.
上述终端,可以包括手机、电脑、可穿戴设备、智能移动设备、虚拟现实设备等,或其任意组合。The aforementioned terminals may include mobile phones, computers, wearable devices, smart mobile devices, virtual reality devices, etc., or any combination thereof.
图1是本公开实施例提供的一个用于日志打印的方法的示意图。结合图1所示,本公开实施例提供一种可应用于第一服务端的日志打印的方法,可以包括:Fig. 1 is a schematic diagram of a method for log printing provided by an embodiment of the present disclosure. As shown in FIG. 1 , an embodiment of the present disclosure provides a log printing method applicable to the first server, which may include:
S11,第一服务端发送监控指令至监控端。S11, the first server sends a monitoring instruction to the monitoring terminal.
可选地,在第一服务端发送监控指令至监控端前,还包括:第一服务端保存并加载默认的日志级别对应的配置文件。这样,在调整日志级别前,仍然可以根据默认的日志级别启动相应的日志打印服务,便于用户在线上对问题进行初步溯源。Optionally, before the first server sends the monitoring instruction to the monitoring end, the method further includes: the first server saves and loads a configuration file corresponding to a default log level. In this way, before adjusting the log level, the corresponding log printing service can still be started according to the default log level, which is convenient for users to trace the source of the problem online.
可选地,本公开实施例中的监控端可以是Zookeeper服务器(分布式应用程序协调服务)关联的监控端。因此,在第一服务端发送监控指令至Zookeeper服务器关联的监控端时,第一服务端默认向Zookeeper服务器注册监听功能,以便监听目标服务器节点的信息。或者,监控端可以是Redis服务器(Remote Dictionary Server,远程字典服务)关联的监控端。因此,在第一服务端发送监控指令至Redis服务器关联的监控端时,第一服务端默认订阅目标服务器的信息频道,以便订阅目标服务器的消息队列。通过上述监控端,均可以便于后续接收到日志级别调整信息,从而使第一服务端根据该日志级别调整信息动态地调整目标服务器的日志级别,方式简单,易于操作。Optionally, the monitoring terminal in this embodiment of the present disclosure may be a monitoring terminal associated with a Zookeeper server (distributed application coordination service). Therefore, when the first server sends a monitoring command to the monitoring terminal associated with the Zookeeper server, the first server registers the monitoring function with the Zookeeper server by default, so as to monitor the information of the target server node. Alternatively, the monitoring terminal may be a monitoring terminal associated with a Redis server (Remote Dictionary Server, remote dictionary service). Therefore, when the first server sends a monitoring instruction to the monitoring terminal associated with the Redis server, the first server subscribes to the information channel of the target server by default, so as to subscribe to the message queue of the target server. Through the above monitoring terminal, it is convenient to receive the log level adjustment information subsequently, so that the first server dynamically adjusts the log level of the target server according to the log level adjustment information, which is simple and easy to operate.
S12,根据监控端返回的信息确定需要进行日志级别调整的目标服务器,监控端返回的信息至少包括目标服务器的标识信息和目标服务器的日志级别调整信息。S12. Determine the target server that needs to adjust the log level according to the information returned by the monitoring terminal. The information returned by the monitoring terminal includes at least identification information of the target server and log level adjustment information of the target server.
其中,目标服务器可以是分布式系统中需要进行日志级别调整的单个服务器;或者,目标服务器可以是分布式系统中需要进行日志级别调整的多个服务器。Wherein, the target server may be a single server in the distributed system that needs to adjust the log level; or, the target server may be multiple servers in the distributed system that need to adjust the log level.
可选地,监控端返回的信息可以仅包括目标服务器的标识信息和目标服务器的日志级别调整信息,这样,第一客户端可以直接确定需要进行日志级别调整的目标服务器,便于后续快速调整日志级别。或者,监控端返回的信息可以包括分布式系统中所有服务器的标识信息以及各服务器对应的日志级别调整信息,在这种情况下,日志级别调整信息中可以包括是否需要调整服务器的日志级别,以及该服务器需要调整的具体级别信息,第一服务端可以根据监控端返回的各服务器对应的日志级别调整信息确定目标服务器。Optionally, the information returned by the monitoring terminal may only include the identification information of the target server and the log level adjustment information of the target server. In this way, the first client can directly determine the target server that needs to be adjusted to the log level, so as to facilitate the subsequent rapid adjustment of the log level . Alternatively, the information returned by the monitoring terminal may include the identification information of all servers in the distributed system and the log level adjustment information corresponding to each server. In this case, the log level adjustment information may include whether the log level of the server needs to be adjusted, and For the specific level information that the server needs to adjust, the first server can determine the target server according to the log level adjustment information corresponding to each server returned by the monitoring end.
S13,根据日志级别调整信息调整目标服务器的日志级别。S13. Adjust the log level of the target server according to the log level adjustment information.
其中,日志级别调整信息至少包括目标服务器的目标日志级别。Wherein, the log level adjustment information at least includes the target log level of the target server.
可选地,本公开实施例可以提供多种实现方获得日志级别调整信息对应的配置文件。下面举例说明。Optionally, the embodiments of the present disclosure may provide configuration files corresponding to various implementation parties obtaining log level adjustment information. The following example illustrates.
一种方式下,第一服务端可以直接在本地保存多种日志级别对应的配置文件,如此,第一服务端获得日志级别调整信息时,即获得目标服务器的目标日志级别时,可以直接调用目标日志级别对应的配置文件,这样,可以实现对配置文件的多次调用,也有助于减少监控端返回的数据量,整体提高运行效率。In one way, the first server can directly save the configuration files corresponding to various log levels locally. In this way, when the first server obtains the log level adjustment information, that is, when it obtains the target log level of the target server, it can directly call the target The configuration file corresponding to the log level. In this way, multiple calls to the configuration file can be realized, which also helps to reduce the amount of data returned by the monitoring terminal and improve the overall operating efficiency.
另一种方式下,监控端可以保存多种日志级别对应的配置文件,如此,在向第一服务端返回信息时,可以将目标日志级别对应的配置文件一起返回至第一服务端。或者,第二客户端可以保存多种日志级别对应的配置文件,这样,在第二客户端将日志级别调整指令发送至监控端时,可以将目标日志级别对应的配置文件一起发送至监控端,以便监控端在获得第一服务端发送的监控指令时,将日志级别调整信息以及目标日志级别对应的配置文件一起发送至第一服务端,供第一服务端调整目标服务器的日志级别。In another way, the monitoring end can save configuration files corresponding to various log levels, so that when returning information to the first server, the configuration files corresponding to the target log level can be returned to the first server together. Alternatively, the second client can save configuration files corresponding to multiple log levels, so that when the second client sends the log level adjustment instruction to the monitoring end, it can send the configuration files corresponding to the target log level to the monitoring end together, In order for the monitoring terminal to send the log level adjustment information and the configuration file corresponding to the target log level to the first server together when obtaining the monitoring command sent by the first server, for the first server to adjust the log level of the target server.
可选地,在第一服务器获得目标日志级别对应的配置文件后,还包括:将目标日志级别对应的配置文件写入目标服务器节点的内存。这样,目标服务器不需要重启就能更新日志级别,减少了重启服务器所带来的风险。Optionally, after the first server obtains the configuration file corresponding to the target log level, the method further includes: writing the configuration file corresponding to the target log level into the memory of the target server node. In this way, the target server can update the log level without restarting, reducing the risk of restarting the server.
其中,服务器的日志级别至少可以包括优先级从高到低依次排列的FATAL(致命)、ERROR(错误)、WARN(警告)、INFO(信息)、DEBUG(调试)五级。从高到低的优先级分别对应从高到低的打印权限,例如,当前服务器节点的日志级别为DEBUG,则对应的打印权限为可以打印高于该日志级别的日志以及等于该日志级别的日志,即可以打印FATAL、ERROR、WARN、INFO和DEBUG级别的日志,也就是可以打印所有日志。Wherein, the log level of the server may at least include five levels of FATAL (fatal), ERROR (error), WARN (warning), INFO (information), and DEBUG (debugging) arranged in descending order of priority. The priority from high to low corresponds to the printing permission from high to low. For example, if the log level of the current server node is DEBUG, the corresponding printing permission is to print logs higher than the log level and logs equal to the log level. , that is, the logs of FATAL, ERROR, WARN, INFO and DEBUG levels can be printed, that is, all logs can be printed.
S14,响应于客户端提交的日志打印服务请求,启动日志打印服务。S14. In response to the log printing service request submitted by the client, start the log printing service.
可选地,本公开实施例可以通过多种实现方式开启日志打印服务,下面举例说明。Optionally, the embodiment of the present disclosure may enable the log printing service in various implementation manners, which are described below with examples.
一种方式下,在第一服务端调整目标服务器的日志级别后,默认调整后的目标服务器的日志级别所对应的打印权限为允许打印所有日志,根据上文所作介绍,此时目标服务器节点对应的日志级别为DEBUG。因此,在这种情况下,可以直接打印目标服务器的日志。In one way, after the first server adjusts the log level of the target server, the default print permission corresponding to the adjusted log level of the target server is to allow printing of all logs. According to the above introduction, the target server node corresponds to The log level is DEBUG. Therefore, in this case, the log of the target server can be printed directly.
另一种方式下,如果调整后的目标服务器的日志级别所对应的打印权限为允许打印部分日志,则响应于客户端提交的日志打印服务请求,启动日志打印服务,可以包括:根据调整后的目标服务器的日志级别,确定打印权限和打印标识信息;如果打印权限表示需要验证打印标识信息,则在打印标识信息验证成功的情况下,启动日志打印服务。根据上文所作介绍,仅DEBUG级别可以打印所有日志,即除DEBUG级别以外,其他日志级别对应的打印权限均需要验证打印标识信息。通过这种验证打印标识信息的方式,可以针对打印标识信息定向开启打印日志服务,方便线上出现问题的时候对问题进行定位溯源。In another way, if the printing permission corresponding to the adjusted log level of the target server is to allow printing part of the logs, then in response to the log printing service request submitted by the client, starting the log printing service may include: according to the adjusted The log level of the target server determines the printing authority and printing identification information; if the printing authority indicates that the printing identification information needs to be verified, the log printing service is started when the printing identification information verification is successful. According to the above introduction, only the DEBUG level can print all logs, that is, except for the DEBUG level, the printing permissions corresponding to other log levels need to verify the print identification information. Through this method of verifying the printed identification information, the print log service can be oriented to the printed identification information, which is convenient for locating and tracing the source of the problem when there is a problem online.
可选地,打印标识信息可以包括业务信息,例如业务运行方式、线上客户的手机号以及目标服务器的IP地址(Internet Protocol Address,网际协议地址)中的一种或多种。其中,业务运行方式为用户开发的后端业务运行方法,例如,后端Service服务的运行方法;或者,后端controller服务的运行方法。Optionally, the print identification information may include service information, such as one or more of service operation mode, mobile phone number of the online customer, and IP address (Internet Protocol Address, Internet Protocol Address) of the target server. Wherein, the business operation mode is a back-end business operation method developed by the user, for example, an operation method of the back-end Service service; or, an operation method of the back-end controller service.
如此,本公开实施例提供一种验证打印标识信息的方法,可以包括:获得客户端提交的打印标识信息;根据客户端提交的打印标识信息和预存打印标识信息,获得打印标识信息验证结果。这样,可以准确、快速地验证打印标识信息,方便针对打印标识信息,即业务信息定向开启日志打印服务。Thus, an embodiment of the present disclosure provides a method for verifying print identification information, which may include: obtaining print identification information submitted by a client; and obtaining a verification result of the print identification information according to the print identification information submitted by the client and the pre-stored print identification information. In this way, the printing identification information can be verified accurately and quickly, and it is convenient to start the log printing service for the printing identification information, that is, business information.
其中,本公开实施例可以通过多种实现方式获得客户端提交的打印标识信息。作为一种示例,第一服务端可以直接根据客户端提交的日志打印服务请求,获得打印标识信息。作为另一种示例,第一服务端可以再次和客户端通信,发送标识发送请求指令至客户端,以便客户端响应于该标识发送请求,将打印标识信息发送至第一服务端。对此,本公开实施例可以不做具体限定。Wherein, the embodiments of the present disclosure may obtain the printing identification information submitted by the client through various implementation manners. As an example, the first server may directly obtain the printing identification information according to the log printing service request submitted by the client. As another example, the first server may communicate with the client again, and send an identifier sending request instruction to the client, so that the client sends the print identifier information to the first server in response to the identifier sending request. In this regard, the embodiments of the present disclosure may not make specific limitations.
可选地,客户端提交的打印标识信息由客户端关联的用户输入。作为一种示例,客户端关联的终端可以配置信息录入模块,用户直接通过信息录入模块,将打印标识信息录入该终端关联的客户端。例如,信息录入模块可以体现为键盘,用户可以通过键盘手动输入打印标识信息,供客户端采集;或者,信息录入模块可以体现为语音采集模块,用户可以通过语音方式输入打印标识信息,由客户端进行语音识别,获得打印标识信息。采用以上方式都可以使用户方便快捷地路录入打印标识信息,以便用户关联的客户端将打印标识信息发送至第一服务器。Optionally, the printing identification information submitted by the client is input by a user associated with the client. As an example, the terminal associated with the client may be configured with an information entry module, and the user directly enters the print identification information into the client associated with the terminal through the information entry module. For example, the information input module can be embodied as a keyboard, and the user can manually input the print identification information through the keyboard for the client to collect; or, the information input module can be embodied as a voice collection module, and the user can input the print identification information by voice, and the client Carry out speech recognition and obtain printing identification information. All of the above methods can enable the user to enter the printing identification information conveniently and quickly, so that the client associated with the user can send the printing identification information to the first server.
可选地,如果打印权限表示需要验证打印标识信息,则在打印标识信息验证失败的情况下,可以取消日志打印服务。本公开实施例中的取消日志打印服务,可以是在所有打印标识信息均验证失败的情况下,取消日志打印服务。或者,可以是在任一打印标识信息验证失败的情况下,取消日志打印服务。对此可根据实际的生产环境设置,本公开实施例亦不做具体限定。Optionally, if the printing authority indicates that the printing identification information needs to be verified, the log printing service may be canceled if the verification of the printing identification information fails. The cancellation of the log printing service in the embodiment of the present disclosure may be canceling the log printing service when all the print identification information fails to be verified. Alternatively, the log printing service may be canceled when any of the print identification information fails to be verified. This can be set according to the actual production environment, and is not specifically limited in the embodiments of the present disclosure.
在实际应用过程中,以打印标识信息为线上客户A的手机号为例,项目启动后,在需要验证线上客户A的手机号的情况下,获取预存的线上客户A的手机号为Aa,并输入线上客户A的手机号AA,与预存手机号进行匹配。本示例中,线上客户的手机号验证失败,此时可以取消日志打印服务;或者,可以继续验证其他打印标识信息。In the actual application process, take the printed identification information as the mobile phone number of online customer A as an example. After the project starts, if the mobile phone number of online customer A needs to be verified, the pre-stored mobile phone number of online customer A is obtained. Aa, and enter the mobile phone number AA of online customer A to match with the pre-stored mobile phone number. In this example, the verification of the mobile phone number of the online customer fails, and the log printing service can be canceled at this time; or, other printing identification information can be continued to be verified.
综上,采用本公开实施例提供的可应用于第一服务端的日志打印的方法,可以在调整日志级别的时候减轻服务器负载压力,减小请求耗时。并且,在提供日志打印服务的时候扩大了日志打印的范围,解决在线上出现问题的时候,仅能打印部分日志级别对应的日志,不好对问题进行溯源的问题。此外,通过直接对目标服务器节点的日志级别进行调整,而无需针对各个服务器节点调用接口,可以简化操作流程,便于用户操作,从而提高用户的使用体验。To sum up, by adopting the log printing method applicable to the first server provided by the embodiment of the present disclosure, the server load pressure can be reduced when adjusting the log level, and the request time consumption can be reduced. In addition, when providing log printing services, the scope of log printing is expanded to solve the problem that when problems occur online, only some logs corresponding to the log level can be printed, and it is difficult to trace the source of the problem. In addition, by directly adjusting the log level of the target server node without invoking an interface for each server node, the operation process can be simplified and the user's operation can be facilitated, thereby improving the user experience.
可选地,启动日志打印服务后,还包括:清理预存打印标识信息,并关闭日志打印服务。其中,关闭日志打印服务可以是在完成日志打印服务的情况下,关闭日志打印服务;或者,可以是在完成问题溯源并解决的情况下,关闭日志打印服务。这样不会占用过多内存,可以使得整个日志打印服务非常灵活易用。Optionally, after starting the log printing service, it also includes: clearing the pre-stored printing identification information, and closing the log printing service. Wherein, closing the log printing service may be closing the log printing service after the log printing service is completed; or may be closing the log printing service after completing the source tracing and solving of the problem. This will not take up too much memory, which can make the entire log printing service very flexible and easy to use.
可选地,在关闭日志打印服务或取消日志打印服务后,还包括:获取日志打印服务数据;将日志打印服务数据返回至客户端。这样,可以使客户端关联的用户及时获取到整个日志打印服务过程的数据,方便在打印过程出现问题的时候,对问题进行溯源和修复。Optionally, after closing the log printing service or canceling the log printing service, the method further includes: obtaining log printing service data; and returning the log printing service data to the client. In this way, the users associated with the client can obtain the data of the entire log printing service process in time, so that when a problem occurs in the printing process, the source of the problem can be traced and repaired.
图2是本公开实施例提供的另一个用于日志打印的方法的示意图。结合图2所示,本公开实施例提供一种可应用于监控端的日志打印的方法,可以包括:Fig. 2 is a schematic diagram of another method for printing a log provided by an embodiment of the present disclosure. As shown in FIG. 2, the embodiment of the present disclosure provides a log printing method applicable to the monitoring terminal, which may include:
S21,监控端获得第二服务端发送的日志级别调整指令,日志级别调整指令由客户端关联的用户提交至第二服务端,且日志级别调整指令包括待调整的目标服务器的标识信息以及目标服务器的日志级别调整信息。S21, the monitoring terminal obtains the log level adjustment instruction sent by the second server, the log level adjustment instruction is submitted to the second server by the user associated with the client, and the log level adjustment instruction includes the identification information of the target server to be adjusted and the target server The log level adjustment information for .
可选地,本公开实施例中监控端可以通过多种实现方式获得日志级别调整指令,下面举例说明。Optionally, in the embodiment of the present disclosure, the monitoring terminal may obtain the log level adjustment instruction through various implementation manners, which are described below with examples.
一种方式下,监控端可以实时获得第二服务端发送的日志级别调整指令,实时获取的方式可以提高服务效率,减少请求耗时,从而提高用户的使用体验。另一种方式下,监控端可以通过轮询的方式获得第二服务端发送的日志级别调整指令,这样实现起来较为简单。In one way, the monitoring terminal can obtain the log level adjustment instruction sent by the second server in real time. The real-time acquisition method can improve service efficiency, reduce time-consuming requests, and improve user experience. In another way, the monitoring end can obtain the log level adjustment instruction sent by the second server end through polling, which is relatively simple to implement.
S22,响应于第一服务端发送的监控指令,将日志级别调整指令提交至第一服务端,以便第一服务端根据日志级别调整信息调整目标服务器的日志级别,并根据调整后的日志级别提供日志打印服务。S22. In response to the monitoring instruction sent by the first server, submit the log level adjustment instruction to the first server, so that the first server adjusts the log level of the target server according to the log level adjustment information, and provides Log printing service.
综上,采用本公开实施例提供的可应用于监控端的日志打印的方法,可以使监控端很方便地获取日志级别调整指令,便于后续第一服务端根据监控端发送的日志级别调整信息调整目标服务器的日志级别,从而在调整日志级别的时候可以减轻服务器负载压力,减小请求耗时。并且,可以为日志打印服务的时候扩大日志打印的范围,方便在线上出现问题的时候,对问题进行溯源。To sum up, the log printing method applicable to the monitoring terminal provided by the disclosed embodiment can enable the monitoring terminal to easily obtain the log level adjustment instruction, so that the subsequent first server can adjust the target according to the log level adjustment information sent by the monitoring terminal. The log level of the server, so that when adjusting the log level, the server load pressure can be reduced, and the request time consumption can be reduced. In addition, the scope of log printing can be expanded when providing log printing services, so that when problems occur online, the problem can be traced to the source.
图3是本公开实施例提供的另一个用于日志打印的方法的示意图。结合图3所示,本公开实施例提供一种可应用于第二服务端的日志打印的方法,可以包括:Fig. 3 is a schematic diagram of another method for printing a log provided by an embodiment of the present disclosure. As shown in FIG. 3 , an embodiment of the present disclosure provides a log printing method applicable to the second server, which may include:
S31,第二服务端获得客户端关联的用户输入的日志级别调整指令,日志级别调整指令包括待调整的目标服务器的标识信息以及目标服务器的日志级别调整信息。S31. The second server obtains a log level adjustment instruction input by a user associated with the client, where the log level adjustment instruction includes identification information of a target server to be adjusted and log level adjustment information of the target server.
可选地,用户可以直接将日志级别调整指令输入第二服务端,以便第二服务端获得日志级别调整指令。Optionally, the user may directly input the log level adjustment instruction into the second server, so that the second server can obtain the log level adjustment instruction.
在实际应用过程中,为了进一步简化用户操作,第二服务端可以提供日志级别选择界面,该日志级别选择界面中包括预存的目标服务器节点的多个日志级别,用户通过选择预存日志级别的方式确定日志级别调整指令,这样有助于降低对用户专业技能的要求,提高用户的使用体验。此外,也能减少用户在手动输入日志级别调整指令的时候所产生的错误,提高日志级别调整效率和准确性。In the actual application process, in order to further simplify user operations, the second server can provide a log level selection interface. The log level selection interface includes multiple log levels of the pre-stored target server node. The user determines the log level by selecting the pre-stored log level. Log level adjustment instructions, which help reduce the requirements for users' professional skills and improve user experience. In addition, it can also reduce errors generated when users manually input log level adjustment instructions, and improve the efficiency and accuracy of log level adjustment.
S32,将日志级别调整指令发送至监控端,以便监控端在获得第一服务端发送的监控指令时,将日志级别调整指令发送至第一服务端,由第一服务端根据日志级别调整信息调整目标服务器的日志级别,并根据调整后的日志级别提供日志打印服务。S32. Send the log level adjustment instruction to the monitoring terminal, so that when the monitoring terminal obtains the monitoring instruction sent by the first server end, it sends the log level adjustment instruction to the first server end, and the first server end adjusts the log level according to the log level adjustment information. The log level of the target server, and provide log printing service according to the adjusted log level.
如上文所做介绍,本公开实施例中的监控端可以是Zookeeper服务器关联的监控端,或者,Redis服务器关联的监控端。如此,本公开实施例可以通过多种实现方式将日志级别调整指令发送至监控端。一种方式下,第二服务端将日志级别调整指令发送至Zookeeper服务器关联的监控端,即将日志级别调整指令写入Zookeeper服务器关联的监控端所监听的目标服务器节点。另一种方式下,第二服务端将日志级别调整指令发送至Redis服务器关联的监控端,即将日志级别调整指令发布到Redis服务器关联的监控端所订阅的目标服务器的消息队列。As introduced above, the monitoring terminal in the embodiment of the present disclosure may be a monitoring terminal associated with a Zookeeper server, or a monitoring terminal associated with a Redis server. In this way, the embodiment of the present disclosure can send the log level adjustment instruction to the monitoring terminal through various implementation manners. In one way, the second server sends the log level adjustment command to the monitoring terminal associated with the Zookeeper server, that is, writes the log level adjustment command into the target server node monitored by the monitoring terminal associated with the Zookeeper server. In another way, the second server sends the log level adjustment command to the monitoring terminal associated with the Redis server, that is, the log level adjustment command is issued to the message queue of the target server subscribed by the monitoring terminal associated with the Redis server.
通过以上方式,均可以使监控端方便地获得日志级别调整指令,便于后续过程中将该日志级别调整指令发送至第一服务端,且不会影响到其他业务请求,有助于提高调整过程的灵活性。Through the above methods, the monitoring terminal can easily obtain the log level adjustment instruction, which is convenient for sending the log level adjustment instruction to the first server in the subsequent process, and will not affect other business requests, which helps to improve the efficiency of the adjustment process. flexibility.
综上,采用本公开实施例提供的可应用于第二服务端的日志打印的方法,用户将日志级别调整指令输入第二服务端后,第二服务端仅需要通知,即发送日志级别调整指令至监控端就可以实现后续的日志级别调整流程,简化了线上操作,同时减轻服务器负载压力,减小请求耗时,提高了用户的使用体验。In summary, using the log printing method applicable to the second server end provided by the embodiment of the present disclosure, after the user inputs the log level adjustment instruction into the second server end, the second server end only needs to notify, that is, send the log level adjustment instruction to The monitoring terminal can realize the subsequent log level adjustment process, which simplifies online operations, reduces server load pressure, reduces request time consumption, and improves user experience.
图4是本公开实施例提供的另一个用于日志打印的方法的示意图。结合图4所示,本公开实施例提供一种用于日志打印的方法,可以包括:Fig. 4 is a schematic diagram of another method for printing a log provided by an embodiment of the present disclosure. As shown in FIG. 4 , an embodiment of the present disclosure provides a method for printing a log, which may include:
S41,第二服务端获得客户端关联的用户输入的日志级别调整指令,发送至监控端;该日志级别调整指令包括待调整的目标服务器的标识信息以及目标服务器的日志级别调整信息。S41. The second server obtains a log level adjustment instruction input by a user associated with the client, and sends it to the monitoring end; the log level adjustment instruction includes identification information of a target server to be adjusted and log level adjustment information of the target server.
S42,监控端响应于第一服务端发送的监控指令,将该日志级别调整指令提交至第一服务端。S42, the monitoring end submits the log level adjustment instruction to the first server in response to the monitoring instruction sent by the first server.
S43,第一服务端根据监控端返回的信息确定需要进行日志级别调整的目标服务器。S43. The first server determines the target server that needs to adjust the log level according to the information returned by the monitoring terminal.
S44,第一服务端根据日志级别调整信息调整目标服务器的日志级别。S44. The first server adjusts the log level of the target server according to the log level adjustment information.
S45,客户端提交日志打印服务请求至第一服务端。S45, the client submits a log printing service request to the first server.
S46,第一服务端启动日志打印服务。S46, the first server starts the log printing service.
采用本公开实施例提供的用于日志打印的方法,第一服务端、监控端、第二服务端和客户端四者相配合,可以在调整日志级别的时候减轻服务器负载压力,减少请求耗时。同时,这种方式在日志打印的时候可以扩大日志打印的范围,方便线上问题溯源。Using the method for log printing provided by the embodiment of the present disclosure, the first server, the monitoring end, the second server and the client cooperate to reduce the load pressure on the server and reduce the time-consuming request when adjusting the log level . At the same time, this method can expand the scope of log printing when printing logs, and facilitate online problem tracing.
在实际应用过程中,监控端以Zookeeper服务器关联的监控端为例。第一服务端可以发送监控指令至Zookeeper服务器关联的监控端,以便该监控端注册监听功能后,监听目标服务器节点的信息。用户将日志级别调整指令输入第二服务端,该日志级别调整指令包括待调整的目标服务器的标识信息以及目标服务器的日志级别调整信息,即可将目标服务器节点的日志级别调整为DEBUG级别。第二服务端将该日志级别调整指令发送至Zookeeper服务器关联的监控端,以便该监控端响应于第一服务端发送的监控指令,将该日志级别调整指令提交至第一服务端。第一服务端根据该监控端返回的信息可以确定目标服务器,并将目标服务器调整至DEBUG级别。对目标服务器的日志级别进行调整后,第一服务端响应于客户端提交的日志打印服务请求,开启日志打印服务,此时可以打印目标服务器节点的所有日志。In the actual application process, the monitoring terminal takes the monitoring terminal associated with the Zookeeper server as an example. The first server can send a monitoring command to a monitoring terminal associated with the Zookeeper server, so that the monitoring terminal can monitor the information of the target server node after registering the monitoring function. The user inputs the log level adjustment command into the second server, the log level adjustment command includes the identification information of the target server to be adjusted and the log level adjustment information of the target server, and the log level of the target server node can be adjusted to DEBUG level. The second server sends the log level adjustment command to the monitoring terminal associated with the Zookeeper server, so that the monitoring terminal submits the log level adjustment command to the first server in response to the monitoring command sent by the first server. The first server can determine the target server according to the information returned by the monitoring terminal, and adjust the target server to the DEBUG level. After adjusting the log level of the target server, the first server starts the log printing service in response to the log printing service request submitted by the client, and can print all logs of the target server node at this time.
图5是本公开实施例提供的一个用于日志打印装置的示意图。结合图5所示,本公开实施例提供一种用于日志打印的装置,包括处理器(processor)100和存储器(memory)101。可选地,该装置还可以包括通信接口(Communication Interface)102和总线103。其中,处理器100、通信接口102、存储器101可以通过总线103完成相互间的通信。通信接口102可以用于信息传输。处理器100可以调用存储器101中的逻辑指令,以执行上述实施例的用于日志打印的方法。Fig. 5 is a schematic diagram of a log printing device provided by an embodiment of the present disclosure. As shown in FIG. 5 , an embodiment of the present disclosure provides an apparatus for printing a log, including a processor (processor) 100 and a memory (memory) 101 . Optionally, the device may further include a communication interface (Communication Interface) 102 and a
此外,上述的存储器101中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。In addition, the above logic instructions in the
存储器101作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如本公开实施例中的方法对应的程序指令/模块。处理器100通过运行存储在存储器101中的程序指令/模块,从而执行功能应用以及数据处理,即实现上述实施例中用于日志打印的方法。As a computer-readable storage medium, the
存储器101可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器101可以包括高速随机存取存储器,还可以包括非易失性存储器。The
本公开实施例提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述用于日志打印的方法。An embodiment of the present disclosure provides a computer-readable storage medium, storing computer-executable instructions, and the computer-executable instructions are configured to execute the above method for log printing.
本公开实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述用于日志打印的方法。An embodiment of the present disclosure provides a computer program product, the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer, the The computer executes the above method for log printing.
上述的计算机可读存储介质可以是暂态计算机可读存储介质,也可以是非暂态计算机可读存储介质。The above-mentioned computer-readable storage medium may be a transitory computer-readable storage medium, or a non-transitory computer-readable storage medium.
本公开实施例的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The technical solutions of the embodiments of the present disclosure can be embodied in the form of software products, which are stored in a storage medium and include one or more instructions to make a computer device (which can be a personal computer, a server, or a network equipment, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc. A medium that can store program code, or a transitory storage medium.
以上描述和附图充分地示出了本公开的实施例,以使本领域的技术人员能够实践它们。其他实施例可以包括结构的、逻辑的、电气的、过程的以及其他的改变。实施例仅代表可能的变化。除非明确要求,否则单独的部件和功能是可选的,并且操作的顺序可以变化。一些实施例的部分和特征可以被包括在或替换其他实施例的部分和特征。而且,本申请中使用的用词仅用于描述实施例并且不用于限制权利要求。如在实施例以及权利要求的描述中使用的,除非上下文清楚地表明,否则单数形式的“一个”(a)、“一个”(an)和“所述”(the)旨在同样包括复数形式。类似地,如在本申请中所使用的术语“和/或”是指包含一个或一个以上相关联的列出的任何以及所有可能的组合。另外,当用于本申请中时,术语“包括”(comprise)及其变型“包括”(comprises)和/或包括(comprising)等指陈述的特征、整体、步骤、操作、元素,和/或组件的存在,但不排除一个或一个以上其它特征、整体、步骤、操作、元素、组件和/或这些的分组的存在或添加。在没有更多限制的情况下,由语句“包括一个…”限定的要素,并不排除在包括所述要素的过程、方法或者设备中还存在另外的相同要素。本文中,每个实施例重点说明的可以是与其他实施例的不同之处,各个实施例之间相同相似部分可以互相参见。对于实施例公开的方法、产品等而言,如果其与实施例公开的方法部分相对应,那么相关之处可以参见方法部分的描述。The above description and drawings sufficiently illustrate the embodiments of the present disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, procedural, and other changes. The examples merely represent possible variations. Individual components and functions are optional unless explicitly required, and the order of operations may vary. Portions and features of some embodiments may be included in or substituted for those of other embodiments. Also, the terms used in the present application are used to describe the embodiments only and are not used to limit the claims. As used in the examples and description of the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well unless the context clearly indicates otherwise . Similarly, the term "and/or" as used in this application is meant to include any and all possible combinations of one or more of the associated listed ones. Additionally, when used in this application, the term "comprise" and its variants "comprises" and/or comprising (comprising) etc. refer to stated features, integers, steps, operations, elements, and/or The presence of a component does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and/or groupings of these. Without further limitations, an element defined by the statement "comprising a ..." does not exclude the presence of additional identical elements in the process, method or apparatus comprising said element. Herein, what each embodiment focuses on may be the difference from other embodiments, and the same and similar parts of the various embodiments may refer to each other. For the method, product, etc. disclosed in the embodiment, if it corresponds to the method part disclosed in the embodiment, then the relevant part can refer to the description of the method part.
本领域技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,可以取决于技术方案的特定应用和设计约束条件。所述技术人员可以对每个特定的应用来使用不同方法以实现所描述的功能,但是这种实现不应认为超出本公开实施例的范围。所述技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software may depend on the specific application and design constraints of the technical solution. Said artisans may implement the described functions using different methods for each particular application, but such implementation should not be regarded as exceeding the scope of the disclosed embodiments. The skilled person can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
本文所披露的实施例中,所揭露的方法、产品(包括但不限于装置、设备等),可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,可以仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例。另外,在本公开实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units may only be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined Or it can be integrated into another system, or some features can be ignored, or not implemented. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiments of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
附图中的流程图和框图显示了根据本公开实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这可以依所涉及的功能而定。在附图中的流程图和框图所对应的描述中,不同的方框所对应的操作或步骤也可以以不同于描述中所披露的顺序发生,有时不同的操作或步骤之间不存在特定的顺序。例如,两个连续的操作或步骤实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这可以依所涉及的功能而定。框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or part of code that includes one or more Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than that disclosed in the description, and sometimes there is no specific agreement between different operations or steps. order. For example, two consecutive operations or steps may, in fact, be performed substantially concurrently, or they may sometimes be performed in the reverse order, depending upon the functionality involved. Each block in the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by dedicated hardware implemented in combination with computer instructions.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011501427.1A CN112486435B (en) | 2020-12-17 | 2020-12-17 | Method, system and device for log printing |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011501427.1A CN112486435B (en) | 2020-12-17 | 2020-12-17 | Method, system and device for log printing |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN112486435A CN112486435A (en) | 2021-03-12 |
| CN112486435B true CN112486435B (en) | 2023-02-03 |
Family
ID=74914143
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011501427.1A Active CN112486435B (en) | 2020-12-17 | 2020-12-17 | Method, system and device for log printing |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN112486435B (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114064477A (en) * | 2021-11-16 | 2022-02-18 | 中国平安人寿保险股份有限公司 | Recommendation strategy testing method and device, computer equipment and storage medium |
| CN114116523A (en) * | 2022-01-28 | 2022-03-01 | 广东睿江云计算股份有限公司 | Framework debugging method and framework debugging system |
| CN115269535A (en) * | 2022-07-29 | 2022-11-01 | 招商局金融科技有限公司 | Process log management method and device, computer equipment and storage medium |
| CN115657981A (en) * | 2022-11-10 | 2023-01-31 | 北京物芯科技有限责任公司 | Method for setting print level of print information in authentication environment and authentication method |
| CN119621488A (en) * | 2025-02-12 | 2025-03-14 | 苏州元脑智能科技有限公司 | Log printing method, device, equipment, storage medium and program product |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109284267A (en) * | 2018-09-26 | 2019-01-29 | 深圳壹账通智能科技有限公司 | Log management method and terminal device based on exception monitoring |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8296358B2 (en) * | 2009-05-14 | 2012-10-23 | Hewlett-Packard Development Company, L.P. | Method and system for journaling data updates in a distributed file system |
| CN106681891A (en) * | 2015-11-05 | 2017-05-17 | 阿里巴巴集团控股有限公司 | Method and device for adjusting log level in Java application system |
| CN108846070A (en) * | 2018-06-07 | 2018-11-20 | 北京京东尚科信息技术有限公司 | Log processing method, system, electronic equipment and the storage medium of distributed system |
| CN109471845A (en) * | 2018-10-25 | 2019-03-15 | 深圳壹账通智能科技有限公司 | Log management method, server, and computer-readable storage medium |
| US11290541B2 (en) * | 2019-03-19 | 2022-03-29 | International Business Machines Corporation | Synchronous client-side log service |
-
2020
- 2020-12-17 CN CN202011501427.1A patent/CN112486435B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109284267A (en) * | 2018-09-26 | 2019-01-29 | 深圳壹账通智能科技有限公司 | Log management method and terminal device based on exception monitoring |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112486435A (en) | 2021-03-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112486435B (en) | Method, system and device for log printing | |
| JP7678065B2 (en) | Implementing compliance settings on mobile devices to adhere to configuration scenarios | |
| CN112637346A (en) | Proxy method, device, proxy server and storage medium | |
| CN110427324B (en) | Joint debugging system, joint debugging method, computer equipment and storage medium | |
| US10924590B1 (en) | Virtual workspace experience visualization and optimization | |
| CN113691635B (en) | Method and device for calling microservice, electronic equipment and readable storage medium | |
| WO2022028144A1 (en) | Blockchain management of provisioning failures | |
| CN107707644A (en) | Processing method, device, storage medium, processor and the terminal of request message | |
| CN111240855A (en) | API debugging system, method, storage medium and computer device | |
| CN104902432A (en) | Method and device for generating application operation log of terminal mobile | |
| CN115766553A (en) | VPN device state secret testing method and device, electronic device and storage medium | |
| CN115619559A (en) | Consensus transaction visualization method, device, equipment and storage medium | |
| US10341420B1 (en) | Approaches for preparing and delivering bulk data to clients | |
| CN114371866A (en) | Version reconstruction testing method, device and equipment of business system | |
| WO2021189253A1 (en) | Data transmission method and apparatus | |
| CN110930253A (en) | Intelligent contract internal main key generation method and device, computer equipment and storage medium | |
| CN113535020B (en) | Method, apparatus, device, medium and product for generating application icons | |
| CN114222001B (en) | Edge device, edge device method, edge device system, electronic device and storage medium | |
| CN116208396A (en) | Authentication method of access request, device storage medium and electronic device | |
| CN113986738A (en) | Interface parameter checking method and device, electronic equipment and storage medium | |
| CN113986755A (en) | Message comparison method and device, storage medium and electronic device | |
| CN118433169B (en) | Configuration method and device for reading timeout time and electronic equipment | |
| US10671505B2 (en) | System and method for monitoring service | |
| CN113901377B (en) | Service calling method, device, storage medium and equipment of legacy system | |
| CN115412435B (en) | Customer service quality inspection processing method and device, computer equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |
