Application log coding method, device and computer readable storage medium

By introducing conversion appenders and log subconverters in Java applications, the development habit changes in Java application log coding output and third-party log processing problems are solved, and the simplification and security of diversified log coding output is achieved.

CN113704820BActive Publication Date: 2024-11-26CHINA UNIONPAY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110919923.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-11
Publication Date
2024-11-26
Estimated Expiration
2041-08-11

AI Technical Summary

Technical Problem

When log coding and outputting in Java applications, the prior art requires additional preprocessing steps, which affects development habits and cannot process logs independently output in third-party library, resulting in poor results.

Method used

By introducing a conversion appender between the native logger and the native appender, loading the log converter and log subconverter, receiving log messages and performing log coding, a variety of converters are provided such as Regular, Json, Base64, ISO8583, Adapt to diversified conversion needs.

Benefits of technology

It realizes diversified log coding output without modifying the application, simplifies the development process, adapts to diversified conversion needs, and ensures the security of log output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113704820B_ABST
    Figure CN113704820B_ABST
Patent Text Reader

Abstract

The present invention provides an application log coding output method, device, system and computer-readable storage medium, the method comprising: using the extension mechanism of the native log recorder to load the conversion appender, using the conversion appender to load the log converter and the native appender for outputting log messages, the log converter includes one or more log sub-converters, and using the log converter to load the log sub-converter specified by the initialization parameter; using the conversion appender to receive the log message sent by the native log recorder, calling the log sub-converter specified by the initialization parameter to perform log coding, and sending the processed log to the native appender for safe output. Using the above method, diversified log coding output can be achieved without laborious application modification, which is more friendly to developers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of logs, and in particular relates to an application log coding output method, device and computer-readable storage medium. Background Art

[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] When Java applications call conventional log frameworks such as log4j, they input and output the original text. If the log content contains sensitive information, the sensitive information will be output to the console or log file. At this time, if you need to implement coded output for sensitive information, you generally need to use various means to convert the log content with sensitive information according to fixed logic before the application calls the log framework to output the log, and then use the converted coded content as input to call the log framework for output.

[0004] However, this is equivalent to requiring explicit additional coding preprocessing before each call to the log framework to output logs. The API for application call logs will change, and the application needs to be modified. This solution has a significant change in the programming habits of developers, and if the preprocessing is omitted before a log printing call due to negligence, the coding effect cannot be achieved. In addition, it is impossible to process logs output independently in some third-party libraries.

[0005] Therefore, the coding output of logs applied to JAVA application logs is an urgent problem to be solved. Summary of the invention

[0006] In view of the problems existing in the above-mentioned prior art, a method, device and computer-readable storage medium for coding and outputting application logs are proposed. By using this method, device and computer-readable storage medium, the above-mentioned problems can be solved.

[0007] The present invention provides the following solutions.

[0008] In a first aspect, a method for encoding and outputting an application log is provided, comprising: utilizing an extension mechanism of a native logger to load a conversion appender, utilizing the conversion appender to load a log converter and a native appender for outputting log messages, wherein the log converter comprises one or more log sub-converters, and utilizing the log converter to load a log sub-converter specified by an initialization parameter; utilizing the conversion appender to receive a log message sent by a native logger, calling the log sub-converter specified by the initialization parameter to perform log encoding, and sending the processed log to the native appender for secure output.

[0009] In one embodiment, both the native logger and the native appender are native modules of the JAVA logging framework.

[0010] In one embodiment, the log converter includes one or more of the following log sub-converters: a regular converter, a Json converter, a Base64 converter, and an ISO8583 converter.

[0011] In one embodiment, the conversion appender is loaded using the extension mechanism of the native logger, and also includes: the native logger loads the conversion appender based on a configuration file; the configuration file includes: appender class identifiers of one or more native appenders, log sub-converter class identifiers of one or more log sub-converters, and conversion rules corresponding to one or more log sub-converters.

[0012] In one embodiment, the conversion rules corresponding to one or more log sub-converters include: regular conversion rules, which are used to replace the parts of the original log content that match the regular match according to preset replacement rules; Json conversion rules, which are used to specify the field name and replacement method of the Json object; ISO8583 conversion rules, which are used to specify the field number and replacement method of the 8583 message object.

[0013] In one implementation, the Json conversion rule and the ISO8583 conversion rule nestedly call the regular converter or the Base64 converter during conversion.

[0014] In one embodiment, the native appender includes one or more of the following: a console appender, a file appender, a socket appender, and an SMTP mail appender.

[0015] In one embodiment, the conversion appender is compatible with any one or more of the following JAVA logging frameworks: slf4j, log4j, log4j2, logback, common-logging.

[0016] In one embodiment, it is configured to execute the method of the first aspect and includes: a native logger, configured to load a conversion appender based on an extension mechanism; a conversion appender, configured to load a log converter and a native appender for outputting log messages, the log converter including one or more log sub-converters; a log converter, configured to load a log sub-converter specified by an initialization parameter; and a conversion appender, configured to also receive log messages sent by the native logger, call the log sub-converter specified by the initialization parameter to perform log encoding, and send the processed logs to the native appender for secure output.

[0017] In a third aspect, a log coding output device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute: the method of the first aspect.

[0018] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program, and when the program is executed by a multi-core processor, the multi-core processor executes the method of the first aspect.

[0019] At least one of the above-mentioned technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: in this embodiment, a conversion appender for log coding is introduced between the native log recorder and the native appender, so that diversified log coding output can be achieved without laborious application modification, which is more friendly to developers, and one or more log sub-converters are provided for selection, which can further adapt to diversified conversion needs.

[0020] It should be understood that the above description is only an overview of the technical solution of the present invention, so that the technical means of the present invention can be more clearly understood and implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described below by way of example. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The advantages and benefits of the present invention and other advantages and benefits will be apparent to those skilled in the art by reading the detailed description of the exemplary embodiments below. The accompanying drawings are only used for the purpose of illustrating exemplary embodiments and are not to be considered as limiting the present invention. Moreover, the same reference numerals are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0022] Figure 1 2 is a schematic diagram of the structure of an application log coding output device according to an embodiment of the present invention;

[0023] Figure 2 A schematic diagram of a flow chart of a method for coding and outputting application logs according to an embodiment of the present invention;

[0024] Figure 3 The figure is a schematic diagram of implementing a method for coding and outputting application logs according to an embodiment of the present invention.

[0025] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0026] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0027] In the description of the embodiments of the present application, it should be understood that terms such as "including" or "having" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in this specification, and are not intended to exclude the possibility of the presence of one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof.

[0028] Unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in this article is merely a way to describe the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0029] The terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.

[0030] All codes in this application are exemplary, and those skilled in the art may think of various modifications based on the programming language used, specific needs, personal habits and other factors without departing from the concept of this application.

[0031] In order to clearly explain the embodiments of the present application, some concepts that may appear in subsequent embodiments will be introduced first.

[0032] Concept Description

[0033] API (Application Programming Interface) is a predefined interface, such as a function or HTTP interface.

[0034] Logger, the native logger, is the Java native logging API.

[0035] slf4j (Simple logging facade for Java) is a simple Java logging facade that provides a simple and unified interface for the logging API, allowing users to configure the implementation of the logging facade during deployment.

[0036] Log4j (Logging for Java) is an open source Java logging component used to control the destination of log output, such as console, file, etc. Log4j2 is an upgraded version of log4j.

[0037] Logback is another logging component.

[0038] Common-logging is a general-purpose log that has an open source general-purpose log interface component and is compatible with lightweight and independent of specific log implementation tools.

[0039] JSON (JavaScript Object Notation) is a lightweight data exchange format.

[0040] BASE64 is a code that represents binary data based on 64 printable characters.

[0041] ISO8583 (International organization for standardization 8583message, 8583 message international standard package) refers to an international standard message format, which is widely used in bank cards.

[0042] It should also be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0043] like Figure 1 As shown, Figure 1 It is a structural diagram of the hardware operating environment involved in the embodiment of the present invention.

[0044] It should be noted that Figure 1 That is, it is a structural diagram of the hardware operating environment of the log coding output device. The log coding output device according to the embodiment of the present invention can be a terminal device such as a PC, a portable computer, etc.

[0045] like Figure 1As shown, the log coding output device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0046] Those skilled in the art will understand that Figure 1 The log coding output device structure shown in the figure does not constitute a limitation on the log coding output device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0047] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a log coding output instruction (program). Among them, the operating system is a program that manages and controls the hardware and software resources of the log coding output device, and supports the operation of the log coding output program and other software or programs.

[0048] exist Figure 1 In the log coding output device shown, the user interface 1003 is mainly used to send requests, data, etc.; the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; and the processor 1001 can be used to call the log coding output program stored in the memory 1005 and perform the following operations:

[0049] Initialization step: using the extension mechanism of the native logger to load the conversion appender, using the conversion appender to load the log converter and the native appender for outputting log messages, the log converter includes one or more log sub-converters, and using the log converter to load the log sub-converter specified by the initialization parameter;

[0050] Operation steps: using the conversion appender to receive the log message sent by the native logger, calling the log sub-converter specified by the initialization parameter to perform log encoding, and sending the processed log to the native appender for secure output.

[0051] By introducing a conversion appender between the native logger and the native appender, you can achieve diversified log encoding output without the need to modify the application. In addition, since the log conversion logic can be separated from the business logic, it is easy to maintain the business code. And providing one or more log sub-converters for selection can further adapt to diversified conversion needs.

[0052] Figure 2 This is a flow chart of a log coding output method according to an embodiment of the present application, which is used to code and output logs. In this flow, from the device perspective, the execution subject can be one or more electronic devices; from the program perspective, the execution subject can correspondingly be the program installed on these electronic devices.

[0053] like Figure 2 As shown, the method provided in this embodiment may include the following steps:

[0054] S201, using the extension mechanism of the native logger to load the conversion appender, using the conversion appender to load the log converter and the native appender for outputting log messages, and using the log converter to load the log sub-converter specified by the initialization parameter; wherein the log converter includes one or more log sub-converters,

[0055] The above S201 is an initialization step. Specifically, an initialization parameter is required to perform the above initialization. The initialization parameter specifies the log sub-converter. Optionally, the initialization parameter can also specify a native appender.

[0056] In an example, a regular converter is used as an example for detailed description. The native logger is initialized as Logger.getLogger("regular converter identifier"), where Logger is a Java native logger. The appender-ref ref = "regular converter name" configured corresponding to the native logger specifies the log sub-converter.

[0057] Optionally, multiple different native loggers can be declared or initialized, such as Logger1 and Logger2, and different native loggers can be further mapped to different log sub-converters, such as regular expression converters and BASE64 converters, so that programmers can select different declared native loggers to complete log coding output according to the content of the log to be output at the location where the application code is to output the log.

[0058] In one embodiment, the native logger and the native appender may both be native modules of the JAVA logging framework.

[0059] In one embodiment, in S201, the native logger loads the conversion appender based on the configuration file, and the configuration file includes: an appender class identifier of one or more native appenders, a log subconverter class identifier of one or more log subconverters, and a conversion rule corresponding to the one or more log subconverters. The above-mentioned native appenders and log subconverters are included in the configuration file in the form of class names, and the conversion appender can load any one or more required native appenders and log subconverters based on the class names.

[0060] In one embodiment, the native appender includes, but is not limited to, one or more of the following: a console appender, a file appender, a socket appender, an SMTP mail appender, and other native appenders. Of course, other native appenders may also be included, and this application does not impose specific restrictions on this. Thus, the log can be output to a console or a file as required.

[0061] In one example, the console appender may be org.apache.log4j.ConsoleAppender, etc. In one embodiment, the conversion appender is compatible with any one or more of the following JAVA log frameworks: slf4j, log4j, log4j2, logback, common-logging.

[0062] In one embodiment, the log converter includes one or more of the following log sub-converters: a regular converter, a Json converter, a Base64 converter, and an ISO8583 converter, so that various types of encoding conversions can be provided. Of course, other log sub-converters may also be included, and this application does not impose specific restrictions on this.

[0063] Furthermore, except for the Base64 converter that directly encodes the log content into Base64, other sub-converters also rely on the conversion rules in the configuration file for conversion. The conversion rules specifically include:

[0064] 1. Regular conversion rules, which are used to replace the parts of the original log content that match the regular match according to the preset replacement rules. Examples include: {\"regex\":\"^(\\\\d{6})\\\\d+(\\\\d{4})$\","replacement\":\"$1****$2\"}, which can support multiple rules to be configured at the same time. The regular conversion rule means that the parts of the original log content received by the filter that match the regular match are replaced according to the replacement rule pointed to by replacement. For example, "6228880000000008" can be converted to "622888******0008".

[0065] 2. Json conversion rules are used to specify the field name and replacement method of the Json object; the conversion configuration of the Json converter needs to specify the field name and replacement method of the Json object. In the specific implementation, regular conversion can be nested (here, the Json conversion can also be implemented by calling the implemented Base64 conversion).

[0066] 3. ISO8583 conversion rules, which are used to specify the domain number and replacement method of the 8583 message object. The conversion configuration of the ISO8583 converter needs to specify the domain number and replacement method of the 8583 message object. In the specific implementation, regular conversion can be nested.

[0067] In this embodiment, the purpose of specifying the field name of the Json object or the field name of the ISO8583 message object is to improve the conversion efficiency. Because the regular conversion can theoretically realize various coding scenarios, such as bank card strings, mobile phone number strings, ID number strings, etc., there are efficiency problems such as misjudgment leading to excessive coding or multiple regular filtering of the full input log content. Therefore, this application further provides a sub-converter for Json objects and ISO8583 objects commonly used in daily development processes.

[0068] S202, using the conversion appender to receive the log message sent by the native logger, calling the log sub-converter specified by the initialization parameter to perform log coding, and sending the processed log to the native appender for secure output.

[0069] S202 is the actual operation step of the log coding output. In an example, refer to Figure 3, shows an implementation schematic diagram of this embodiment, in which the arrows represent the logical relationship of the application log coding device of this application. The white blocks in the above figure are Java native or third-party log components, such as JAVA applications, native log recorders, console appenders, file appenders, etc. The gray block parts are the various elements used for log coding in this application, including conversion appenders, log converters, and various log sub-converters (regular converters, JSON converters, Base64 converters, ISO8583 converters). Using the extension mechanism provided by each log framework, the conversion appender is extended to implement the conversion appender, which internally integrates the native appenders and log converters compatible with each log framework. Among them, 1. The native log recorder obtains log messages from the JAVA application. 2. The native log recorder calls the conversion appender and passes the log message to the conversion appender. 3. The conversion appender calls the log converter and passes the log content to the log converter. 4. The log converter calls the log sub-converter to use the log sub-converter to code or convert the sensitive information in the log content. 5. The log converter passes the coded and converted log message back to the conversion appender. 6. The conversion appender passes the converted log message to the native appender of the logging framework for content output, thereby ensuring the security of the output information.

[0070] In the traditional JAVA application log output solution, after the native logger obtains the log message generated in the JAVA application, it will directly output it through the console appender or the file appender. In this solution, by inserting a conversion appender between the native logger and the native appender, the log message sent by the native logger can be coded and converted, and then the coded and converted log message can be output through the native appender. The whole process is not noticeable to the JAVA application end.

[0071] The following is a detailed description of the technical solution provided by this embodiment in conjunction with the pseudo code of the application example:

[0072]

[0073] The output after executing the exemplary program of the embodiment of the present application is:

[0074] >INFO Main-622888******0008

[0075] >INFO Main-aGVsbG8=

[0076] In other words, as in the above example, logger1 / 2, you only need to initialize the native logger, and you can use it repeatedly within its scope. In addition, you can declare and initialize multiple different native loggers within its scope, so that the programmer can select the declared different native loggers according to the content of the log to be output at the location where the application code is to output the log to complete the log coding output. In this way, there is almost no change in programming habits, and there is no change in the log content and parameters to be output. The name of the native logger, logger1 / 2, is itself a temporary variable, which can be remembered within its scope.

[0077] In the description of this specification, the description with reference to the terms "some possible implementations", "some embodiments", "examples", "specific examples", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0078] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0079] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0080] About the method flow chart of the embodiment of the present application, some operations are described as different steps performed in a certain order.Such flow chart belongs to illustrative and non-restrictive.Some steps described in this article can be grouped together and performed in a single operation, some steps can be divided into multiple sub-steps, and some steps can be performed in an order different from that shown in this article.The various steps shown in the flow chart can be realized in any way by any circuit structure and / or tangible mechanism (for example, by software, hardware (for example, the logical function realized by processor or chip) etc. running on computer equipment and / or any combination thereof).

[0081] Based on the same technical concept, an embodiment of the present invention further provides a log coding output device, which is used to execute the log coding output method provided in any of the above embodiments.

[0082] The device includes: a native log recorder, which is configured to load a conversion appender based on an extension mechanism; a conversion appender, which is configured to load a log converter and a native appender for outputting log messages, wherein the log converter includes one or more log sub-converters; a log converter, which is configured to load a log sub-converter specified by an initialization parameter; and a conversion appender, which is configured to receive log messages sent by the native log recorder, call the log sub-converter specified by the initialization parameter to perform log coding, and send the processed log to the native appender for secure output.

[0083] According to some embodiments of the present application, a non-volatile computer storage medium of a log coding output method is provided, on which computer executable instructions are stored, and the computer executable instructions are configured to execute the method described in the above embodiment when executed by a processor.

[0084] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, their descriptions are simplified, and the relevant parts can be referred to the partial description of the method embodiments.

[0085] The apparatus, device and computer-readable storage medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the apparatus, device and computer-readable storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the apparatus, device and computer-readable storage medium will not be repeated here.

[0086] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.

Claims

1. A method for coding and outputting application logs. It is characterized in that include: The conversion appender is loaded by using the extension mechanism of the native logger, and the log converter and the native appender for outputting log messages are loaded by using the conversion appender, wherein the log converter includes one or more log sub-converters, and the log sub-converter specified by the initialization parameter is loaded by using the log converter; the log converter includes one or more of the following log sub-converters: regular converter, Json converter, Base64 converter, ISO8583 converter; the native appender includes one or more of the following: console appender, file appender, socket appender, SMTP mail appender; The method of using the extension mechanism of the native logger to load the conversion appender also includes: The native logger loads the conversion appender based on a configuration file; The configuration file includes: an appender class identifier of one or more native appenders, a log subconverter class identifier of one or more log subconverters, and conversion rules corresponding to the one or more log subconverters; The native logger is used to obtain log messages. The native logger calls the conversion appender and sends the log messages to the conversion appender. The conversion appender calls the log converter and sends the log messages to the log converter. The log converter calls the log sub-converter specified by the initialization parameters to perform log encoding and sends the processed log to the conversion appender. The conversion appender sends the processed log to the native appender for secure output.

2. The method according to claim 1, It is characterized in that The native logger and the native appender are both native modules of the JAVA log framework.

3. The method according to claim 1, It is characterized in that The conversion rules corresponding to the one or more log sub-converters include: Regular expression conversion rules are used to replace the parts of the original log content that match the regular expression according to the preset replacement rules; Json conversion rules are used to specify the field names and replacement methods of Json objects; ISO8583 conversion rules are used to specify the field numbers and replacement methods of 8583 message objects.

4. The method according to claim 3, It is characterized in that The Json conversion rule and the ISO8583 conversion rule nestedly call the regular converter or the Base64 converter during conversion.

5. The method according to claim 1, It is characterized in that The conversion appender is compatible with any one or more of the following JAVA logging frameworks: slf4j, log4j, log4j2, logback, common-logging.

6. A log coding output device, It is characterized in that is configured to perform the method according to any one of claims 1 to 5, and comprises: A native logger, configured to load transformation appenders based on the extension mechanism; The conversion appender is configured to load a log converter and a native appender for outputting log messages, wherein the log converter includes one or more log sub-converters; The log converter is configured to load the log sub-converter specified by the initialization parameters; The conversion appender is configured to receive log messages sent by the native logger, call the log sub-converter specified by the initialization parameter to perform log encoding, and send the processed logs to the native appender for secure output.

7. A log coding output device, It is characterized in that include: at least one processor; And, a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable at least one processor to execute: a method as described in any one of claims 1-5.

8. A computer-readable storage medium storing a program, wherein when the program is executed by a multi-core processor, the multi-core processor executes the method according to any one of claims 1 to 5.