The present invention relates to the field of computer programs, and more particularly to a system and method for enabling multiple processes to efficiently log events.
During operation of a system or application, it is often desirable to record information about various types of actions, operations, or situations that occur. Recording such information is known as “logging an event”. A system or application may log an event for any of various purposes, e.g., to record performance information, to record information related to system security, to record debugging information, to record other informational messages regarding runtime operation of an application, etc.
As distributed systems and applications have continued to proliferate, it has become more important to provide flexible means enabling client executable modules to easily and reliably log events to a central event log. When a client executable module needs to log an event, the client module may call an event logging service. One drawback of many prior art event logging systems and methods is that the event logging service may synchronously log the event, while the calling module waits. It may instead be desirable to enable client modules to notify an event service of an event and then resume execution as quickly as possible. The event service may then log the event asynchronously, which may involve persistently storing the event in a remote location, etc.
Also, many prior art event logging services execute out-of-process from calling modules. Performing inter-process communication when logging events may result in significant performance degradation, especially for client modules that log many events. It may instead be desirable to enable a client module to interface with an event service that executes in-process with the module, thus avoiding any possible overhead involved in process-switching.
As noted above, systems and applications may log events for many different purposes. Many of these events may not need to be logged at all times. For example, application developers often include calls to log informational messages, for development or debugging purposes. For day-to-day operation of a system or application, it may not be necessary or desirable to log these types of events. Thus, it may be desirable to enable event filtering criteria to be specified, e.g., using a logging administration tool.
As noted above, distributed systems and applications often maintain a centralized event log or database. It may be desirable to enable new event logging criteria to be specified and have the criteria information be automatically propagated to each client, so that clients dynamically alter the types of events they send to the centralized event log, without requiring code to be recompiled, or the event service to be re-started, etc.
The problems outlined above may in large part be solved by providing a system and method for enabling multiple processes to efficiently log events, as described herein. A client executable module that needs to log an event may interface with a module or component referred to as a “client-side logging component”. In one embodiment, the client-side logging component executes in process with the client module. The client module may pass the client-side logging component various types of information regarding the event, such as an associated event level, one or more associated event categories, an informational message, etc.
A computer system process may have multiple executable modules that are associated with the process, such as DLLs, shared libraries, component objects, etc. For a particular process, each associated module may interface with a single instance of a client-side logging component. The client-side logging component instance for each process may interface with a central server-side logging component instance. Processes running on multiple computers may call the server-side logging component to log events, via the client-side logging component instance for the process.
A logging administration tool may be utilized in order to set event logging criteria. For example, the logging administration tool may enable an administrator to specify that only events of particular levels should be logged, or that only events associated with certain event categories should be logged, etc. In response to being configured with new event logging criteria information, the server-side logging component may automatically propagate the logging criteria information to each of the client-side logging components. The client-side logging components may then begin using the new logging criteria, dynamically changing the filtering of events that are sent to the server-side logging component.
A better understanding of the present invention can be obtained when the following detailed description of the preferred embodiment is considered in conjunction with the following drawings, in which:
While the invention is susceptible to various modifications and alternative forms, specific embodiments are shown by way of example in the drawings and are herein described in detail. It should be understood however, that drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed. But on the contrary the invention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the present invention as defined by the appended claims.
Incorporation by Reference
The following references are hereby incorporated by reference.
For information on the Component Object Model, please refer to:
For information on the Distributed Component Object Model, please refer to:
For more information on Windows programming, please refer to:
As shown in
Each module 0.108 may, at times, need to log various types of events. The modules may need to log events for any of various purposes, such as:
Each event logged by a module may be associated with one or more event “categories”. Event categories may be defined in any of various ways. For example, in one embodiment, events are categorized according to the four purposes shown above. Since event categories may overlap, each event may be associated with multiple categories. For example, an event for recording memory usage information may be useful for both application performance and debugging purposes. Thus, an event mask may be used to specify the event categories that an event is associated with. For example, bit constants may be defined for each event category, such as:
The mask may then be created by ORing together the relevant bit constants.
It is noted that, in other embodiments, events may be categorized in various ways other than the categories shown above. Also, the level of scope of the event categories may be different. For example, if desired, may more event categories may be defined in order to provide a finer level of detail what each event relates to. For example, the “performance” category shown above may be split into categories related to resource consumption, time-based information, etc. Although the particular event mask implementation shown above may only allow a limited number of event categories to be defined, event masks may, of course, be implemented in any of various other ways. For example, a hierarchical system may be used to categorize events.
Each event logged by a module may also be associated with one or more event “levels”. Event levels may specify the “importance” of an event, using any various arbitrary schemes to define this “importance”. For example, in one embodiment, four event levels are defined as follows:
Each event logged by a module may also have an associated message, e.g., an informational text message, such as “Starting scheduler”. These messages may be arbitrary text strings, may be strings defined in a resource file, etc.
As shown in
As indicated by the arrows 112, each client-side logging component associated with a process 110 may interface with a server-side logging component 100, in order to propagate the events to be logged. The server-side logging component 100 may execute out-of-process from the client-side logging components. In one embodiment, the client-side logging component 106 is implemented as an out-of-process COM object.
As shown in
As shown in
As shown in
The server-side logging component may interface with the client-side logging components in any of various ways in order to propagate the logging criteria information. In one embodiment, the server-side logging component and the client-side logging components are implemented as Component Object Model (COM) components, and the propagation of logging criteria information is implemented through the use of standard COM event mechanisms. For more information on communication among COM components, please refer to the above-incorporated references.
Upon receiving a request to log an event from a module 108, the client-side logging component 106 is preferably enabled to determine whether the event to be logged satisfies the logging criteria received from the server-side logging component 100. For example, if the logging criteria specify that only events of a certain level or higher are to be logged, then the client-side logging component 106 may simply ignore events of a lower level. Thus, unnecessary communication between the client-side logging components 106 and the server-side logging component 100 may be avoided, which may significantly benefit application or system performance. For example, applications often include many calls for logging low-priority informational messages, e.g., for application development or debugging purposes. An administrator may easily suspend or reinstate the logging of these types of messages, simply by setting the appropriate logging criteria.
As noted above, various of the elements shown in
As shown in
As shown in
As shown in
As described, above, a user, e.g., an administrator, may utilize a logging administration tool 104 to manage event logging. The logging administration tool 104 may comprise a graphical user interface (GUI).
As shown in the “Log Filters” section of
As shown by the “Log Level” GUI control of
As shown in
The client-side logging component 106 may be constructed according to any of various programming methodologies or component specifications, e.g., as a COM component, CORBA component, JavaBeans component, etc. The client-side logging component may provide various functions or methods callable by modules 108 in order to log events.
As noted above, in one embodiment, the client-side logging component is implemented as a COM-object: Appendix A is a COM interface definition language (IDL) file illustrating a definition for an “IHSLog” interface comprising a Logo method, as well as various other methods. Client modules may obtain an IHSLog interface pointer, using standard COM methods, and call the Logo method to log an event. As noted above, the client-side logging component may execute in-process with the client module, so that no process-switch is involved in this call.
As shown in
objLog—>Log (HSCLInfo, HSCLDebug I HSCLOperator, “Starting scheduler with % d threads”, threadCount);
where the first and second parameters specify an event level and event category mask, respectively, for the event, and the message is programmatically filled in using the threadCount integer.
As shown in Appendix A, the client-side logging component may comprise various other methods, such as methods enabling messages to be retrieved from resource files, methods enabling clients written in languages such as Visual J++ to call methods of the client-side logging component with different numbers of arguments, etc.
In one embodiment, the client-side logging component is enabled to maintain an event queue 202 for events to be logged, as shown in
The client-side logging component is preferably enabled to handle runtime issues regarding concurrency. For example, as shown in
In step 302, the client module calls an interface method in order to log an event. For example, the client may call a Logo method similar to the
As described above, the client-side logging component may maintain information specifying the types of events that should be logged. In step 304, the client-side logging component uses the information received from the client module in step 302 to determine whether the event should be logged, e.g., by determining whether the one or more event categories for the event are event categories for which events should be logged, etc. If the client-side logging component determines that the event should not be logged, then the client-side logging component may simply return execution control to the client module.
If the client-side logging component determines that the event received from the client module is an event that should be logged, then the client-side logging component may timestamp the event, as shown in step 306. For example, step 306 may involve creating a data structure representing the event, calling a system function to determine the current time, adding the time information to the data structure, etc. The server-side logging component may use the timestamp information as described below.
As shown in step 308, the client-side logging component may then queue the event and return execution control to the client module. The client-side logging component may implement the event queue using any of various well-known techniques. As discussed above with reference to
In step 320, the client-side logging component event queue manager may obtain a reference to a server-side logging component interface. For example, the server-side logging component may be implemented according to a software component model and may provide an interface for client-side logging components to use, similar to the way the
In step 322, the client-side logging component event queue manager waits for an event to be queued. Step 322 may be implemented using any of various well-known techniques, as appropriate to a particular operating system, development environment, etc. For example, the event queue manager may be a thread that wakes up periodically to check for new events.
If an event is present, then in step 324 the client-side logging component event queue manager retrieves the event and uses the server-side logging component interface obtained in step 320 to call a method for logging the event. The client-side logging component may pass the server-side logging component information regarding the event, such as the event level, the associated event categories, the event message, the event timestamp, etc. This event information may of course be wrapped in a structure or object representing the event.
As noted above, in one embodiment the client-side logging component and the server-side logging component may execute on separate computers. Thus, step 324 may involve communication between separate computers. In this case, the client-side logging component and the server-side logging component are preferably implemented as components according to a software component model, and the client-side and server-side logging components may utilize built-in communication support provided by the software component model. For example, the Distributed Component Object Model (DCOM) provides support for a client to invoke a method of a component executing on a remote computer.
In step 326, the server-side logging component logs the event information received from the client-side logging component. The server-side logging component may log information such as the event message, the event level, the event categories for the event, the timestamp information, etc. The server side logging component may, of course, also log other types of information. For example, the event information received from the client-side logging component may include information identifying the module or application that initiated the log request, etc.
Similarly as discussed above, the server-side logging component is preferably enabled to handle synchronization and concurrency issues which may arise due to multiple client-side logging components calling the server-side logging component to log events. The server-side logging component may use the event timestamp information to properly order events in the event log, if necessary. Thus the event log information may account for variables such as network latencies involved in sending events from client-side logging components to the server-side logging component.
In one embodiment in which the server-side logging component is called by client-side logging components that are distributed across multiple computers, the multiple computers may be associated with a particular network. In this case, the multiple computers may have synchronized clocks, e.g., clocks that are maintained by a network operating system, for the network. Thus, the event information logged by the server-side logging component may reflect the actual order in which the events occurred as accurately as possible.
As noted above, the server-side logging component may log event information in any of various ways. Events are preferably logged persistently, e.g., by storing them in a file, a database, etc. In one embodiment, the server-side logging component may propagate the event log information to another server for remote storage.
In one embodiment, a logging administration tool may be used in order to set criteria specifying which events to log, as described above.
In step 400, a user, such as an administrator, uses the logging administration tool to set event logging criteria. As discussed above, the event logging criteria may comprise information specifying certain event levels for which events should be logged, e.g., events of a certain importance level or higher. The event logging criteria may also comprise information specifying particular event categories for which events should be logged.
In step 402, the logging administration tool informs the server-side logging component of the new event logging criteria. The logging administration tool may interface with the server-side logging component in any of various ways. For example, the logging administration tool may obtain a reference to an interface provided by the server-side logging component, similarly as described above, where the interface included methods for setting the event logging criteria. Appendix B provides a COM IDL file illustrating an exemplary definition of such an interface, for a COM embodiment of the server-side logging component.
In step 404, the server-side logging component informs the client-side logging components of the new event logging criteria. As noted above, the server-side logging component may interface with the client-side logging components in any way appropriate to a particular implementation in order to propagate the event logging criteria. In one embodiment, the server-side logging component and the client-side logging components are implemented as Component Object Model (COM) components and the propagation of logging criteria information is implemented through the use of standard COM event mechanisms. For more information on communication among COM components, please refer to the above-incorporated references.
When a client-side logging component is first instantiated and begins running, the client-side logging component may locate the server-side logging component to inform the server-side logging component of its existence. Thus the server “knows” about each of the client-side logging components at any given time. Before propagating event logging criteria to a client-side logging component, the server-side logging server may check to ensure that the client-side logging component is still functioning. In one embodiment, client-side logging components are implemented as COM objects, and the server-side logging component is automatically notified when a client-side logging component terminates, e.g., using standard COM notifications for object termination.
In step 406, the client-side logging components update the event-logging criteria information that they maintain with the new event logging criteria received from the server-side logging component. The client-side logging components may then begin using the new event logging criteria to filter events, as described above.
Although the embodiments above have been described in considerable detail, numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated. It is intended that the following claims be interpreted to embrace all such variations and modifications.
This application claims benefit of priority of U.S. provisional application Serial No. titled “System and Method Enabling Multiple Processes to Efficiently Log Events”, filed Nov. 12, 1999, whose inventor was Panagiotis Kougiouris.
A portion of the disclosure of this patent document contains material to which a claim of copyright protection is made. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office patent file or records, but reserves all other rights whatsoever.
Number | Date | Country | |
---|---|---|---|
60165127 | Nov 1999 | US | |
60165118 | Nov 1999 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 09439374 | Nov 1999 | US |
Child | 10690343 | Oct 2003 | US |