The present application claims benefit of priority under 35 USC §120 and §365 to the previously filed Taiwan Patent Application No. 101123680, titled, “Dynamically Adjusting a Log Level of a Transaction” with a priority date of Jun. 29, 2012. The content of that application is incorporated by reference herein.
1. Field of the Disclosure
The present disclosure relates to technology pertaining to log levels of transactions, and more particularly, to a method, computer system, and program product for dynamically adjusting a log level of a transaction.
2. Description of the Prior Art
In a data processing system, a transaction is a related task composed of units known as “success” and “failure”. For example, a transaction processing system (TPS) is typically a data processing system for storing and recording day-to-day business information and conducting day-to-day business, and the TPS usually consists of events, business procedures, and business activities. Normally, a process of processing a transaction involves creating or updating data and thus requires logging to enable tracking or troubleshooting. A detailed log of every transaction (or every record in a database) in the system adds to the use of system resources (for example, processing power, and the use of storage space and memory.)
Logs are recorded at different levels, according to debugging needs. The recorded Logs thus vary from level to level. For example, five consecutive log levels are configured, namely DEBUG, INFO, WARN, ERROR and FATAL, wherein DEBUG is the highest log level, whereas FATAL is the lowest log level. The higher the log level is, the more detailed the log is recorded. Of course, level can vary from system to system. For example, frameworks are recorded in Java at different severity levels (Visit http://en.wikipedia.org/wiki/Java_logging_framework).
The log level being set to DEBUG level is effective in investigating the underlying cause (root cause) of failure of a transaction. However, as described above, logs at DEBUG level have a disadvantage, which is that the DEBUG level logs need plenty of storage space for storing detailed data. In fact, most detailed data are likely to be unrelated to an issue under investigation, and logs at DEBUG level are likely to contain plenty of undesirable noise. The aforesaid drawback is especially obvious because, considering that a device for processing a transaction event is often provided with limited storage space for storing logs and the logs of successful transactions, the logs occupy most of the log space. To debug an issue with the data contained in a log, a system administrator has to spend much time digging into plenty of DEBUG level logs and identifying any logs related to an intended issue. Moreover, assuming that the space for storing logs is inadequate, the device is likely to delete old logs in order to reclaim space for use by a new log. In such a situation, some old but interesting logs are likely to be overwritten by new but useless logs.
Furthermore, when it comes to a system that processes a large amount of transactions concurrently, the big challenge is to identify the root cause of failure of a transaction just by investigating a created log. It is very likely that the failure of a transaction is a collateral result of any other preceding successful transaction. That is to say, the “dependency” between transactions remains unidentified.
There are two conventional solutions of the aforesaid problem. One of the solutions involves lowering the log level and thereby reducing the amount of logs, as disclosed in U.S. Pat. No. 8,156,387 entitled “Method and System for Error Manipulation,” for example. The other solution involves digging into plenty of logs to identify the intended ones, as disclosed in US Pub. 2006/0195731 and US Pub. 2008/0126828, for example. However, the present disclosure recognizes that no prior art discloses correlating concurrent transactions with each other according to the dependency between the transactions. Accordingly, the present disclosure realizes that it is imperative to identify the root cause of failure of a transaction efficiently by means of log data related to an aborted transaction.
Reference throughout this specification to features, advantages, or similar language does not imply that all of the features and advantages that may be realized with the present disclosure should be or are in any single embodiment of the disclosure. Rather, language referring to the features and advantages is understood to mean that a specific feature, advantage, or characteristic described in connection with an embodiment is included in at least one embodiment of the present disclosure. Thus, discussion of the features and advantages, and similar language, throughout this specification may, but do not necessarily, refer to the same embodiment.
Furthermore, the described features, advantages, and characteristics of the disclosure may be combined in any suitable manner in one or more embodiments. One skilled in the relevant art will recognize that the disclosure may be practiced without one or more of the specific features or advantages of a particular embodiment. In other instances, additional features and advantages may be recognized in certain embodiments that may not be present in all embodiments of the disclosure.
The present disclosure provides a new logging mechanism. During the period of time in which a transaction is being processed, the mechanism keeps the most detailed log information in a buffering memory until the transaction is completed and no other transactions are affected by the transaction, so as to (i) adjust the log level of the transaction dynamically according to the transaction results of the current transaction and dependency-defined transactions and (ii) store the necessary log in a hard disk drive or any permanent storage according to the determined log level. For example, if a transaction is successfully completed and there is no correlation between the transaction and any other transactions, the log of the transaction will be filtered by a “success” log filter level (i.e., a success log level). On the other hand, in case of failure of a transaction or failure of any other transaction correlated to the transaction, the log of the transaction will be filtered by a “failure” log filter level (i.e., a failure log level).
To identify those transactions which are related to the current transaction, a transaction dependency for a transaction in terms of a specific dependency factor is created with a list. A specific dependency factor is an attribute, resource or feature shared by two transactions. For example, two transactions may apply to identical destinations, be served by identical threads, originate from identical transmission control protocol (TCP) ports, or access identical virtual memory addresses. In a case when only a specific dependency factor exists between a transaction and another transaction, a “dependency list” that enumerates the transaction dependency of the transaction is created according to the time of arrival of the transaction. When a transaction and any other transactions may share a plurality of dependency factors, a “dependency tree” that enumerates the transaction dependency of a transaction is created. An embodiment of the present disclosure discloses a mechanism whereby an aborted transaction can be tracked back to a preceding transaction, so as to acquire detailed log information for use in identifying the underlying cause of transaction failure efficiently.
According to an embodiment of the present disclosure, the present disclosure provides a computer program product having executable program code for dynamically adjusting a log level of a transaction. The program code comprises code for: buffering a log of a transaction at a highest log level into a memory when the transaction is completed; determining whether all dependency-defined transactions within a dependency list/tree for the transaction are completed; and calculating a log filter level for the transaction, in association with transaction results (one of failure and success) of dependency-defined transactions, in response to completion of all the dependency-defined transactions, wherein the log filter level is a new log level for the transaction.
According to another embodiment of the present disclosure, the present disclosure provides a computer system for use with code conversion in a small target coding space. The computer system comprises: a host, comprising a bus system, a memory connected to the bus system, where the memory comprises an instruction, and a processing unit connected to the bus system, where the processing unit executes the instruction to thereby execute the aforesaid method of code conversion.
According to another embodiment of the present disclosure, the present disclosure provides a computer system for use with code conversion in a small target coding space, and a computer program product stored in a computer-readable device and having a computer-readable program executable by a computer to implement the aforesaid method of code conversion.
The following description, the appended claims, and the embodiments of the present disclosure further illustrate the features and advantages of the present disclosure.
In order that the advantages of the disclosure will be readily understood, a more particular description of the disclosure briefly described above will be rendered by reference to specific embodiments that are illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments of the disclosure and are not therefore to be considered to be limiting of its scope, the disclosure will be described and explained with additional specificity and detail through the use of the accompanying drawings.
Reference throughout this specification to “one embodiment,” “an embodiment,” or similar language means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present disclosure. Thus, appearances of the phrases “in one embodiment,” “in an embodiment,” and similar language throughout this specification may, but do not necessarily, all refer to the same embodiment.
As will be appreciated by one skilled in the art, the present disclosure may be embodied as a computer device or a computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment or an embodiment combining software (including, for example, firmware, resident software, micro-code, etc.) and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, the present disclosure may take the form of a computer program product embodied on any tangible storage device having computer-usable program code embodied on the storage device.
Any combination of one or more computer usable or computer readable medium(s) and/or device(s) may be utilized. The computer-usable or computer-readable medium may be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a transmission media such as those supporting the Internet or an intranet, or a magnetic storage device. Note that the computer-usable or computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory. In the context of this document, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-usable medium may include a propagated data signal with the computer-usable program code embodied therewith, either in baseband or as part of a carrier wave. The computer usable program code may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc.
Computer program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer or server may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
The present disclosure is described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable device that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable device produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Referring now to
The transaction correlation module 120 keeps a transaction dependency according to the setting of dependency factors. The transaction correlation module 120 keeps the status of each transaction. Each transaction has three statuses, namely “transaction in process 300” status, “transaction completed 310” status, and “transaction log flush completed 330” status. Once a transaction reaches transaction log flush completed 330 status, the transaction log processing module 130 will retrieve from the buffer 248 the logs of the transaction and all dependency-defined transactions that are tracked by dependency-defined transactions completed status 320, calculate a transaction log filter level, and eventually create and send the final filtered log to a permanent storage 140, thereby flushing filtered logs to the permanent storage 140. The storage is a database, a file system, or even an external log server (such as a syslog-ng log server).
The transaction processing module 100, the transaction log buffer 248, the transaction correlation module 120, and the transaction log processing module 130 are described in detail below and illustrated with
Computer System
As shown in
The computer device 202 is able to communicate with a service provider server 252 via a network 228 using a network interface 230, which is coupled to system bus 206. Network 228 may be an external network such as the Internet, or an internal network such as an Ethernet or a Virtual Private Network (VPN). Using network 228, the computer device 202 is able to access service provider server 252. The network can also be implemented in any form of a connection, including a fixed connection, such as a local area network (LAN) or a wide area network (WAN), or getting connected to the Internet through a dial-up connection provided by an Internet service provider (ISP). The network connection is not restricted to cable connection and wireless connection. Instead, the network connection can also be implemented by wireless connection in the form of a GSM connection or a Wi-Fi connection for communicating with a client computer. The network further comprises other hardware and software components (not shown), such as an additional computer system, router, and firewall.
A hard drive interface 232 is also coupled to system bus 206. Hard drive interface 232 interfaces with a hard drive 234. In a preferred embodiment, hard drive 234 populates a system memory 236, which is also coupled to system bus 206. Data that populates system memory 236 includes the computer device operating system (OS) 238 and application programs 244.
OS 238 includes a shell 240 for providing transparent user access to resources such as application programs 244. Generally, shell 240 is a program that provides an interpreter and an interface between the user and the operating system. More specifically, shell 240 executes commands that are entered into a command line user interface or from a file. Thus, shell 240 (as it is called in UNIX®), also called a command processor in Windows®, is generally the highest level of the operating system software hierarchy and serves as a command interpreter. The shell provides a system prompt, interprets commands entered by keyboard, mouse, or other user input media, and sends the interpreted command(s) to the appropriate lower levels of the operating system (e.g., a kernel 242) for processing. Note that while shell 240 is a text-based, line-oriented user interface, the present disclosure will equally well support other user interface modes, such as graphical, voice, gestural, etc. As depicted, OS 238 also includes kernel 242, which includes lower levels of functionality for OS 238, including providing essential services required by other parts of OS 238 and application programs 244, including memory management, process and task management, disk management, and mouse and keyboard management.
The hardware framework of a server 252 can be identical or similar to that of the computer device 202, or can be any conventional basic framework, and the present disclosure is not limited thereto. For example, the server 252 can be a desktop computer, a notebook computer, a personal digital assistant (PDA), or a smartphone. However,
The application program 244 comprises the log level dynamic adjustment module 246 and the transaction log buffer 248 of the present disclosure. The log level dynamic adjustment module 246 comprises program modules and instructions. The program modules and instructions adjust a log level “dynamically” and store a log in a hard disk drive or another permanent storage according to the determined log level. The log level dynamic adjustment module 246 is a module in an application program or comes in the form of a daemon. However, in another embodiment, the log level dynamic adjustment module 246 is implemented by a program of any other type.
The hardware elements depicted in the computer device 202 are not intended to be exhaustive, but rather are representative to highlight essential components required by the present disclosure. For instance, computer device 202 may include alternate memory storage devices such as magnetic cassettes, Digital Versatile Disks (DVDs), Bernoulli cartridges, and the like. These and other variations are intended to be within the spirit and scope of the present disclosure.
Process Flow of Dynamically Adjusting a Log Level
Referring to
As described above, each transaction has three statuses, namely “transaction in process 300” status, “transaction completed 310” status, and “transaction log flush completed 330” status. Additionally, the transactions can also include dependency-defined transactions completed status 320 which tracks other transactions that affect the current transaction.
Then, the transaction processing module 100 finishes processing the transaction and enter “transaction completed 310” status (block 450). The transaction could either fail or succeed. Once a transaction enters “transaction completed 310” status, the transaction will release all resources other than the log buffer to the system. The buffer will still be reserved. All logs (including logs at the highest level) will be kept in the buffer 248.
Following, the transaction correlation module 120: updates a dependency list or tree for the transaction (block 460). Related details are described below and illustrated with
Referring to
In response to the transaction's entering “dependency-defined transactions completed 320” status, the transaction log processing module 130 retrieves from the buffer 248 the logs of the transaction and all the dependency-defined transactions (step 530). In one embodiment, step 530 can also follow step 540.
The transaction log processing module 130 calculates and obtains a log filter level of the transaction in association with transaction completion results (that is, failure or success) of the dependency-defined transactions (step 540). The log filter is a new log level for the transaction. In case of failure of the transaction or of any dependency-defined transactions, the log levels of all related transactions will be changed to the most detailed log level (e.g., DEBUG). If there is no transaction failure, a new log filter level of the transaction (i.e., the current transaction) could be determined with the following equation:
new log filter level=Max(the log filter level of the current transaction, Max(log filter level of dependency-defined transactions))
That is to say, the highest log filter level among the log filter level of the current transaction and the log filter levels of dependency-defined transactions serves as a new log filter level for the current transaction.
The present disclosure is not limited to the above-mentioned equation or associated rules, and thus it is also feasible to use other calculation rules in alternate embodiments. For example, in case of the absence of transaction failure, the new log level of the current transaction is determined by giving sole consideration to a comparison of the log level of a transaction having direct dependency with the transaction and the log level of the current transaction. Furthermore, the new log level of each transaction is calculated, preferably starting from the end of a dependency list or tree.
Following, at step 550, the transaction log processing module 130 creates a final necessary filtered log, according to the new log filter level of the transaction and writes the final filtered log to the permanent storage 140, thereby flushing a filtered log to the permanent storage 140. As a result, the transaction enters “transaction log flush completed 330” status, and the log buffer is released.
Referring to
Furthermore, the checking by the transaction correlation module 120 can calculate a dependency score according to specific dependency factors between a new transaction and unfinished transactions. In a case where two transactions apply to identical destinations, the two transactions may feature a high degree of dependency there-between, and the dependency score will be higher. Specified dependency scores can vary from dependency factor to dependency factor. When multiple dependency factors are shared, a total dependency score could be calculated.
At step 630, the transaction correlation module 120 determines whether the new transaction and an unfinished transaction have dependency there-between. That is, the transaction correlation module 120 determines whether the new transaction matches unfinished transactions in terms of dependency factors. For example, step 630 determines whether the new transaction matches unfinished transactions in terms of dependency factors. Thus the transactions have dependency, according to whether the total dependency score is higher than a predetermined threshold. In fact, the chance that a transaction and another transaction have dependency there-between depends on whether the transaction is earlier than the other transaction and whether the transaction and the other transaction share identical dependency factors.
At step 640, the transaction correlation module 120 updates the dependency list/tree by appending the new transaction to the matched transactions. In general, if consideration is given to a dependency factor only, the dependency can be expressed by a list. If consideration is given to more than one dependency factor, the dependency is expressed by a tree, as shown in
Referring to
The foregoing preferred embodiments are provided to illustrate and disclose the technical features of the present disclosure, and are not intended to be restrictive of the scope of the present disclosure. Hence, all equivalent variations or modifications made to the foregoing embodiments without departing from the spirit embodied in the disclosure of the present disclosure should fall within the scope of the present disclosure as set forth in the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
101123680 A | Jun 2012 | TW | national |
Number | Name | Date | Kind |
---|---|---|---|
8099726 | Harris | Jan 2012 | B2 |
8156387 | Njo et al. | Apr 2012 | B2 |
20040068501 | McGoveran | Apr 2004 | A1 |
20040122942 | Green et al. | Jun 2004 | A1 |
20050223366 | Smith et al. | Oct 2005 | A1 |
20060193397 | Kirisawa et al. | Aug 2006 | A1 |
20060195731 | Patterson et al. | Aug 2006 | A1 |
20080126828 | Girouard et al. | May 2008 | A1 |
20100058291 | Hahn et al. | Mar 2010 | A1 |
20110066891 | Wechsler et al. | Mar 2011 | A1 |
Number | Date | Country |
---|---|---|
2011-113354 | Nov 2009 | JP |
WO 0047003 | Jan 1999 | WO |
Entry |
---|
Sushil Patil, A Method to Validate the Integrity of Individual Transactions and Related Interdependent Transactions with Possible Error Recovery, Semantec Corporation, Jan. 30, 2012, US. |
“A Method and Apparatus for Asynchronously Log Processing in Application Servers,” IP.com Disclosure No. IPCOM000210664D, Sep. 8, 2011. |
Wissam, Rashid, Non-Final Office Action, U.S. Appl. No. 14/473,356, The United States Patent and Trademark Office, pp. 1-13, Mar. 3, 2016 (Relevant pp. 1-13). |
Number | Date | Country | |
---|---|---|---|
20140007119 A1 | Jan 2014 | US |