1. Field of the Invention
The field of the invention is data processing, or, more specifically, methods, apparatus, and products for logging in a computer system.
2. Description of Related Art
Logging is used for debugging a software application and record keeping for important business transactions. Record keeping and associated auditing capability is usually required, by law or regulations, for software applications related to medical or financial transactions. Many logging frameworks exist. However, most of these frameworks write logs to a file or a database during the execution of the application or computer program. Such files or databases are stored on hard disk drives. Such a write of a log to a file or database is a very slow process because the disk storage has to be accessed at the proper location on the hard disk. This makes these frameworks unsuitable for applications which require extremely high performance. Examples of such high performance include software applications for financial transactions such as online banking transactions. Requirements for response time in such high performance software applications may be for an entire transaction to be less than 1-2 seconds while a single transaction may result in hundreds of log messages. Thus, it is especially inefficient to try to log each of these log messages to the file or database separately during the time the transaction is being processed.
Methods, apparatus, and products for transaction logging in a computer system are disclosed in this specification. Such computer systems include high speed, low latency computer memory, such as Random Access Memory (‘RAM’) and non-volatile computer memory, such as hard disk drives. In embodiments of the present invention, logging is carried out by: for each transaction of a plurality of transactions in a transaction-based application: beginning execution of the transaction: storing one or more log messages in a message bundle in the high speed, low latency computer memory during execution of the transaction; and upon completion of the transaction, storing the message bundle in a messaging queue. Logging in accordance with embodiments of the present invention also includes: asynchronously with regard to transaction execution: processing, by a logging module, the messaging queue, including identifying one or more log messages stored in message bundles in the messaging queue; and for each identified log message, writing, by the logging module, the log message to the non-volatile computer memory.
The foregoing and other objects, features and advantages of the invention will be apparent from the following more particular descriptions of exemplary embodiments of the invention as illustrated in the accompanying drawings wherein like reference numbers generally represent like parts of exemplary embodiments of the invention.
Exemplary methods, apparatus, and products for logging in a computer system in accordance with the present invention are described with reference to the accompanying drawings, beginning with
The exemplary computer (152a) operates generally for logging according to embodiments of the present invention. The computer (152a) of
Stored in RAM (168) is a transaction-based application (126), a module of computer program instructions that executes one or more transactions, each of which may generate one or more log messages describing activity carried out during the transaction. The transaction-based application (126) in the example of
A log message as the term is used in this specification is a description of an activity carried out during execution of a transaction. Log messages may include a timestamp indicating a time the log message was generated, a descriptor that indicates a type of activity, an identifier of the log message, data describing the activity carried out, and so on. An example of a log message for a financial transaction, for example, may specify a request to transfer funds from a particular bank account, identified in the log message as a bank number, at a particular financial institution, identified by an Internet Protocol (‘IP’) address, amount of funds to transfer, date to execute the transfer, response to the request, a bank account number to receive the funds, and various other data.
A message bundle is a data structure or object configured to store a number of log messages. At the application level—that is, from the perspective of the transaction-based application (126)—a message bundle may be a global variable implemented as an instance of a class. Message bundles may be structured in a format suitable for sending as a data communications message at any level of a data communications protocol. A message bundle, for example, may be formatted as an application-level message, as a transport layer message, network layer message, link layer message, and so on as will occur to readers of skill in the art. Such a message bundle may include a header including, among other information, an intended recipient of the message bundle.
A messaging queue (110) is a buffer for storing message bundles, from which messages are transmitted to an intended recipient. In the example of
In the example of
The logging module (108) in the example of
Also stored in RAM (168) of both computers (152a, 152b) is an operating system (154). Operating systems useful in a computer system that supports logging according to embodiments of the present invention include UNIX™, Linux™, Microsoft XP™, AIX™, IBM's i5/OS™, and others as will occur to those of skill in the art. The operating system (154) off
The computers (152a, 152b) of
The example computers (152a, 152b) of
The exemplary computers of
The arrangement of computer, networks, and other devices making up the exemplary system illustrated in
For further explanation,
Upon completion of the transaction, the method of
In the method of
Asynchronously with regard to transaction execution, the method of
For further explanation,
The method of
Also in the method of
Consider, for further explanation, the following example pseudo-code:
In the example pseudo-code above, the variable “linkedList” is configured as a local variable implementing an instance of the class configured to temporarily store log messages in RAM. The method call “linkedList.add( . . . )” creates within the local variable, a log message with the following fields:
The example “linkedList.add( . . . )” function call may be called once, for each log message generated during execution of a single transaction.
For further explanation,
The method of
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.
Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage 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 magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention 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 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).
Aspects of the present invention are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. 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 medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions 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, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices 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.
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 various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It will be understood from the foregoing description that modifications and changes may be made in various embodiments of the present invention without departing from its true spirit. The descriptions in this specification are for purposes of illustration only and are not to be construed in a limiting sense. The scope of the present invention is limited only by the language of the following claims.