CONTROLLING APPLICATION LOGGING

Controlling application logging, including: identifying one or more relationships between a plurality of classes of an object oriented application; generating a tree structure comprised of a plurality of nodes and a plurality of branches, where each of the plurality of branches is comprised of at least one node from the plurality of nodes, based on the one or more identified relationships, where a first one or more nodes of the plurality of nodes correspond to one or more classes of the object-oriented application; assigning a weight to each of the plurality of branches, based at least in part on an identified relationship corresponding to each of the one or more nodes comprising each of the plurality of branches; and determining a logging level to each branch of the plurality of branches, based on the assigned weight for each branch of the plurality of branches.

BACKGROUND

The field of the invention is data processing, or, more specifically controlling application logging.

SUMMARY

According to embodiments of the present disclosure, various methods, apparatus, and products for controlling application logging are described herein. In some aspects, a computer-implemented method of controlling application logging includes identifying, by a processor, one or more relationships between a plurality of classes of an object oriented application. The method also includes generating, by the processor, a tree structure comprised of a plurality of nodes and a plurality of branches, where each of the plurality of branches is comprised of at least one node from the plurality of nodes. The generation of the tree structure is based on the one or more identified relationships, where a first one or more nodes of the plurality of nodes correspond to one or more classes of the object-oriented application. The method also includes assigning, by the processor, a weight to each of the plurality of branches, based at least in part on an identified relationship corresponding to each of the one or more nodes comprising each of the plurality of branches. The method also includes determining, by the processor, a logging level to each branch of the plurality of branches, based on the assigned weight for each branch of the plurality of branches. This allows for variable logging levels for different branches in an object-oriented application based on a degree to which those branches are present in a tree structure representing the relationship between classes of the object-oriented application.

In some embodiments, the computer-implemented method may further include: monitoring, by the processor, execution of the object-oriented application; updating, based on the monitoring, the weight for each branch of the plurality of branches; and updating, by the processor, based on one or more updated weights, one or more corresponding logging levels for one or more branches of the plurality of branches. This allows for the logging levels for different branches to be updated based on the usage patterns of particular users.

In some embodiments, updating the one or more corresponding logging levels comprises generating, by the processor, a time-series model comprising one or more predictive weights for each branch of the plurality of branches. This allows for the logging levels for different branches to be updated based on a predictive analysis of user behavior.

In some embodiments, a computer system for controlling application logging may include: one or more processors; a memory storage device in communication with the one or more processors, and computer program instructions executable by the one or more processors to perform operations, the operations comprising: identifying, by the one or more processors, one or more relationships between a plurality of classes of an object oriented application; generating, by the one or more processors, a tree structure comprised of a plurality of nodes and a plurality of branches, where each of the plurality of branches is comprised of at least one node from the plurality of nodes, based on the one or more identified relationships, where a first one or more nodes of the plurality of nodes correspond to one or more classes of the object-oriented application; assigning, by the one or more processors, a weight to each of the plurality of branches, based at least in part on an identified relationship corresponding to each of the one or more nodes comprising each of the plurality of branches; and determining, by the one or more processors, a logging level to each branch of the plurality of branches, based on the assigned weight for each branch of the plurality of branches. This allows for variable logging levels for different branches in an object-oriented application based on a degree to which those branches are present in a tree structure representing the relationship between classes of the object-oriented application.

In some embodiments, the operations may further comprise: monitoring, by the one or more processors, execution of the object-oriented application; updating, by the one or more processors, based on the monitoring, the weight for each branch of the plurality of branches; and updating, by the one or more processors, based on one or more updated weights, one or more corresponding logging levels for one or more branches of the plurality of branches. This allows for the logging levels for different branches to be updated based on the usage patterns of particular users.

In some embodiments, updating the one or more corresponding logging levels comprises generating a time-series model comprising one or more predictive weights for each branch of the plurality of branches. This allows for the logging levels for different branches to be updated based on a predictive analysis of user behavior.

In some embodiments, a computer program product for controlling application logging may include: a computer readable storage device, program instructions stored on the computer readable storage device, the program instructions executable by a processor to cause said processor to perform a function, said function comprising: identifying, by the processor, one or more relationships between a plurality of classes of an object oriented application; generating, by the processor, a tree structure comprised of a plurality of nodes and a plurality of branches, where each of the plurality of branches is comprised of at least one node from the plurality of nodes, based on the one or more identified relationships, where a first one or more nodes of the plurality of nodes correspond to one or more classes of the object-oriented application; assigning, by the processor, a weight to each of the plurality of branches, based at least in part on an identified relationship corresponding to each of the one or more nodes comprising each of the plurality of branches; and determining, by the processor, a logging level to each branch of the plurality of branches, based on the assigned weight for each branch of the plurality of branches. This allows for variable logging levels for different branches in an object-oriented application based on a degree to which those branches are present in a tree structure representing the relationship between classes of the object-oriented application.

DETAILED DESCRIPTION

As applications execute in different production environments, various issues may arise. An engineer attempting to address these issues may depend on log data generated during execution of the application, particularly where the issue may be difficult to reproduce. Though more detailed log data may be beneficial in diagnosing application issues, producing logs in greater detail results in increased computational resource utilization, thereby downgrading performance. Conversely, producing less detailed log data may result in performance advantages while being less helpful in diagnosing application issues. Existing approaches for defining the level of specificity or detail for log data requires the parameters and criteria to be defined in advance, which may not be adequate to address issues that arise during execution of the application in a production environment.

To address these concerns, the approaches set forth herein describe approaches for dynamically determining logging levels for an application. Particularly, the approaches set forth herein provide for varying degrees of logging detail or specificity depending on the particular execution paths of the application. Moreover, the approaches set forth herein provide for the ability to update these logging levels depending on the behaviors and activity of a user of the application.

A computer program product embodiment (“CPP embodiment” or “CPP”) is a term used in the present disclosure to describe any set of one, or more, storage media (also called “mediums”) collectively included in a set of one, or more, storage devices that collectively include machine readable code corresponding to instructions and/or data for performing computer operations specified in a given CPP claim. A “storage device” is any tangible device that can retain and store instructions for use by a computer processor. Without limitation, the computer readable storage medium may be an electronic storage medium, a magnetic storage medium, an optical storage medium, an electromagnetic storage medium, a semiconductor storage medium, a mechanical storage medium, or any suitable combination of the foregoing.

Some known types of storage devices that include these mediums include: diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), static random access memory (SRAM), compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanically encoded device (such as punch cards or pits/lands formed in a major surface of a disc) or any suitable combination of the foregoing. A computer readable storage medium, as that term is used in the present disclosure, is not to be construed as storage in the form of transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide, light pulses passing through a fiber optic cable, electrical signals communicated through a wire, and/or other transmission media. As will be understood by those of skill in the art, data is typically moved at some occasional points in time during normal operations of a storage device, such as during access, de-fragmentation or garbage collection, but this does not render the storage device as transitory because the data is not transitory while it is stored.

PERIPHERAL DEVICE SET 114 includes the set of peripheral devices of computer 101.

Controlling application logging as described herein may be performed by the logging configuration code 200 with respect to an object-oriented application 220 as shown in the structure block diagram of FIG. 2. An object-oriented application 220 is an application coded according to object-oriented design principles and may be coded using languages designed or optimized for object-oriented applications including Java, C++, and the like. To begin, a parsing module 202 of the logging configuration code 200 may accept, as input, an object-oriented application 220. The parsing module 202 parses the object-oriented application 220 to generate a tree structure 230 defining relationships between classes of the object-oriented application 220. Parsing the object-oriented application 220 may include parsing a non-executable representation of the object-oriented application 220, such as source code of the object-oriented application 220. An object-oriented application 220 includes multiple defined classes. Each class may include one or more attributes such that each instance of the class (e.g., each object) may have values defined for each of these attributes. Each class may also include one or more methods defined by one or more method definition. A method definition defines what parameters may be input to the method as well as the functional steps of the method itself.

The tree structure 230 may include multiple nodes. In some embodiments, one or more of the nodes may correspond to a class of the object-oriented application 220. In some embodiments, one or more of the nodes may correspond to a particular attribute of a particular class of the application. By parsing the object-oriented application 220 to generate the tree structure 230, a branch (e.g., a link between nodes) may be created in the tree structure 230 based on a method of a particular class including a method that accepts, as a parameter, an attribute of a particular class (e.g., of the same particular class, of a different class).

As an example, assume classes A, B, and C each with attributes A-a1, B-a1, and C-a1, respectively. Further assume that class A includes a method A-M1(C-a1, B-a1), whereby the method A-M1 accepts, as input parameters, attribute C-a1 from class C and attribute B-a1 from class B. In some embodiments, generating the tree structure 230 may include generating branches that link a node for a class having a given method to nodes for classes having the attribute parameters for that method. Continuing with the example above, a first branch may be created from a node corresponding to class A to a node corresponding to class C (due to the method in class A accepting, as a parameter, an attribute of class C) and a second branch may be created from a node corresponding to class A to a node corresponding to class B (due to the method in class A accepting, as a parameter, an attribute of class B).

As another example, in some embodiments, generating the tree structure 230 may include generating branches that link a node for a class having a given method to nodes for the attributes of the parameters for that method. Returning to the example above, a first branch may be created from a node corresponding to class A to a node corresponding to attribute C-a1 and a second branch may be created from a node corresponding to class A to a node corresponding to attribute B-a1. In some embodiments, generating the tree structure 230 may also be performed according to similar approaches above with nodes corresponding to particular methods, or with other degrees of granularity as can be appreciated.

A newly added branch to the tree structure 230 may be assigned a particular weight by the parsing module 202, to be described in further detail below. The weight of each branch in the tree structure 230 may be based on the degree to which a corresponding relationship is identified in the object-oriented application 220. Thus, execution paths with higher degrees of occurrence may be assigned a higher weight compared to execution paths with lower degrees of occurrence. While parsing the object-orient application 220, multiple instances of the same branch (e.g., a same relationship) may be identified. Continuing with the example method A-M1(C-a1, B-a1) above, further assume that class A also includes a method A-M2(C-a1, D-a1), with D-a1 being an attribute of another class D. Assuming that application A-M1 has already been parsed and its branches added to the tree structure 230, parsing A-M2 may identify branches from class A to attributes C-a1 and D-a1. This may cause a newly added branch to be added between a node for class A and a node for attribute D-a1. As a branch already exists between class A and attribute C-a1, the weight for that branch may be updated in response to identifying another relationship or execution path between nodes already included in the tree structure 230.

After generating the tree structure 230, each branch may have a corresponding assigned weight. In some embodiments, an assignment module 204 may assign a logging level 240 to each branch based on the corresponding weight in the tree structure 230. A logging level 240 defines an amount of detail or information to be included in a log message generated in response to an execution path performed along that branch. For example, for the lowest logging level 240, an error may only cause log data to be generated indicating that some error occurred. The next-highest logging level 240 may cause log data to be generated specifying the type of error that occurred and/or an indication of where, in the code, such an error occurred. The highest logging level 240 may cause log data to be generated with additional detail, such as stack traces, runtime information, and the like. In some embodiments, particular logging levels 240 may print information related to particular classes, such as method attribute keywords and the like.

As an example, a logging level 240 for a branch linking a first node corresponding to a first class to a second node corresponding to a second class may define how log information is generated for any method of the first class that accepts, as a parameter, an attribute from the second class. As another example, a logging level 240 for a branch linking a first node corresponding to a first class to a second node corresponding to an attribute of a second class may define how log information is generated for any method of the first class that accepts, as a parameter, the attribute from the second class.

In some embodiments, the logging levels 240 for the various branches of the object-oriented application 220 may be encoded by the assignment module 204 in a configuration file or other data accessed during execution of the object-oriented application 220 such that log data may be generated according to these logging levels 240 during execution. In some embodiments, the logging levels 240 for the various branches of the object-oriented application 220 may be encoded by the assignment module 204 in the source code of the object-oriented application 220 itself such that, once compiled, the object-oriented application 220 will be generated according to these logging levels 240.

The approaches set forth above provide for variable logging levels 240 to be determined for particular execution paths in an object-oriented application 220 based on the relationships between the classes of the object-oriented application 220. However, during actual execution and deployment of an object-oriented application 220, the behavior of the object-oriented application 220 itself may vary between users. Accordingly, it may be beneficial to further tune or update the logging levels 240 for various execution paths based on the usage of the object-oriented application 220 by a user.

Accordingly, in some embodiments, a monitoring module 206 may monitor execution of the object-oriented application 220 in order to gather data describing activity of the object-oriented application 220 during execution, shown as activity 250. In some embodiments, the data describing activity 250 of the object-oriented application 220 may be defined with respect to a particular time window (e.g., one day, one week). Such information may describe, for example, when particular branches of the tree structure 230 (e.g., particular execution paths of the object-oriented application 220) are taken during execution. In some embodiments, each execution of a particular branch may cause the weight associated with that branch to be modified (e.g., increased) by the monitoring module 206. Thus, more frequently taken branches may be assigned a higher weight.

For example, in some embodiments, activity 250 of the object-oriented application 220 during execution may be monitored by the monitoring module 206 such that each instance (e.g., cycle) that a particular execution path corresponding to a particular branch of the tree structure 230 is taken by the object-oriented application 220 is recorded (e.g., in a table or other data structure). Each entry may indicate, for example, the weight to which the branch was updated at that particular cycle. Each entry may also indicate a time at which the particular branch was taken and the table or data structure updated (e.g., a time record). This information may then be provided to the assignment module 204 such that the logging levels 240 for each branch may be updated. Put differently, the updated weights and/or recorded time records may be used by the assignment module 204 to update the logging levels 240 for the different branches of the object-oriented application 220.

As an example, in some embodiments, a prediction module 208 may generate a time-series model 260 based on the recorded updated weights and/or recorded time records to determine, for each branch, predicted weights and time records. These predicted weights and time records may then be used by the assignment module 204 for each branch to determine their updated logging level 240. As an example, an indicator value may be calculated for each branch. An indicator value is a score or quantitative evaluation for that branch based on information such as predicted and/or recorded weights and/or time records for that branch. The indicator value may be calculated according to a variety of approaches based on particular design considerations.

As an example, an indicator value in the future after N cycles may be defined as:

where Wn is the weight at future cycle n and Ubranch-n is the updated time at future cycle n.

The indicator value for each branch may then be used by the assignment module 204 to determine a logging level 240 for that branch. Where the determined logging level 240 for a particular branch is different than the previously assigned logging level 240, the logging level 240 may be updated for that branch. In some embodiments, each logging level 240 may correspond to a particular range of indicator values. A branch having an indicator value falling within a particular range will then have its logging level 240 assigned to the corresponding logging level 240 for that range.

In some embodiments, the indicator value may be modified (e.g., increased or decreased) based on other information associated with execution of the object-oriented application 220 as indicated in the activity 250 monitored by the monitoring module 206. Such information may include, for example, a degree to which exceptions are thrown for a particular branch. For example, when a given method throws an exception during execution, information indicating the exception was thrown may be stored by the monitoring module 206 in association with the branches for that method. Continuing with the example A-M1 above, should an error be thrown, information indicating that an error was thrown may be stored in association with branches linking class A to classes C and B, or to branches linking class A to attributes C-a1 and B-a1, depending on the particular encoding schema used. The indicator values for those branches may be modified based on their associated degrees to which exceptions were thrown. For example, indicator values may be scaled or weighted, or be modified where degrees to which exceptions were thrown exceeds a threshold. This allows branches that may be less frequently taken but have higher degrees of exceptions to be assigned a higher logging level 240. Conversely, more frequently taken branches with low degrees of exception may be assigned a lower logging level 240.

In some embodiments, one or more filtering operations may be applied by the assignment module 204 to the branches before updating their respective logging levels 240. The one or more filtering operations serve to subdivide the branches into multiple groups. As an example, in some embodiments, applying the one or more filtering operations may include clustering the branches based on their respective weights and/or time records. As another example, in some embodiments, applying the one or more filtering operations may include selecting, as a filter group, those branches having an aggregate (e.g., average or other aggregate value) time records and/or weight below a predefined threshold. One or more of the groups defined by the filtering operation may then have a default logging level 240 assigned or be excluded by the prediction module 208 from generating the time-series model 260 described above, thereby improving overall performance.

For further explanation, FIG. 3 shows a flowchart of an example method for controlling application logging according to some embodiments of the present disclosure. The method of FIG. 3 may be performed, for example, by logging configuration code 200 executed in a computing environment 100 as described above. The logging configuration code 200 may be executed in the computing environment 100 and accept, as input, an object-oriented application 200. The method of FIG. 3 includes generating 302 a tree structure 230 comprising a plurality of nodes and a plurality of branches defining relationships between classes of an object-oriented application 220. Generating 302 the tree structure 230 may be performed by the parsing module 202 described above. In some embodiments, generating 302 the tree structure 230 comprises parsing a representation of the object-oriented application 220. Such a representation may include a non-executable representation of the object-oriented application 220, such as source code of the object-oriented application 220.

The tree structure 230 may include multiple nodes. In some embodiments, one or more of the nodes may correspond to a class of the object-oriented application 220. In some embodiments, one or more of the nodes may correspond to a particular attribute of a particular class of the object-oriented application 220. By parsing the object-oriented application 220 to generate the tree structure 230, a branch (e.g., a link between nodes) may be created in the tree structure based on a method of a particular class including a method that accepts, as a parameter, an attribute of a particular class (e.g., of the same particular class, of a different class).

Generating 302 the tree structure may include assigning weights to each branch to be used in assigning their respective logging levels 240. Accordingly, in some embodiments, generating 302 the tree structure includes assigning 304, to each branch of a plurality of branches in the tree structure 230, a weight based on a degree to which a corresponding relationship is identified in the object-oriented application 220. While parsing the object-oriented application 220, a given branch may be identified multiple times by virtue of being represented by multiple different methods. Accordingly, a first instance of a branch being identified may cause data encoding that branch to be stored with some initial weight. As subsequent instances of that branch are identified, the weight for that branch may be updated (e.g., increased).

The method of FIG. 3 also includes assigning 306, based on the weight for each branch of the plurality of branches, a corresponding logging level 240 to each branch of the plurality of branches. Assigning 306 a corresponding logging level 240 to each branch of the plurality of branches may be performed by the assignment module 204 of FIG. 2. A logging level 240 defines an amount of detail or information to be included in a log message generated in response to an execution path performed along that branch. For example, for the lowest logging level 240, an error may only cause log data to be generated indicating that some error occurred. The next-highest logging level 240 may cause log data to be generated specifying the type of error that occurred and/or an indication of where, in the code, such an error occurred. The highest logging level 240 may cause log data to be generated with additional detail, such as stack traces, runtime information, and the like. In some embodiments, particular logging levels 240 may print information related to particular classes, such as method attribute keywords and the like. In some embodiments, each logging level 240 may correspond to a particular weight range. A branch having a weight falling within that range may then be assigned the corresponding logging level 240.

In some embodiments, the logging levels 240 for the various branches of the object-oriented application 220 may be encoded in a configuration file or other data accessed during execution of the object-oriented application 220 such that log data may be generated according to these logging levels 240 during execution. In some embodiments, the logging levels 240 for the various branches of the object-oriented application 220 may be encoded in the source code of the object-oriented application 220 itself such that, once compiled, the object-oriented application 220 will be generated according to these logging levels 240.

For further explanation, FIG. 4 sets forth a flowchart of an example method of controlling application logging in accordance with some embodiments of the present disclosure. The method of FIG. 4 is similar to FIG. 3 in that the method of FIG. 4 also includes: generating 302 a tree structure 230 comprising a plurality of nodes and a plurality of branches defining relationships between classes of an object-oriented application, including assigning 304, to each branch of a plurality of branches in the tree structure 230, a weight based on a degree to which a corresponding relationship is identified in the object-oriented application 220; and assigning 306, based on the weight for each branch of the plurality of branches, a corresponding logging level to each branch of the plurality of branches.

The method of FIG. 4 differs from FIG. 3 in that the method of FIG. 4 also includes updating 402 the weight for each branch of the plurality of branches based on data describing activity of the object-oriented application 220 during execution of the object-oriented application 220. Updating 204 the weight for each branch of the plurality of branches based on data describing activity of the object-oriented application 220 during execution of the object-oriented application may be performed by the monitoring module 206 of FIG. 2. The data describing activity of the object-oriented application 220 during execution of the object-oriented application 220 may include a table or data structure indicating when a particular branch is taken during execution of the object-oriented application 220. For example, execution of the object-oriented application 220 may be monitored over a particular time window to identify when a particular branch is taken during execution of the object-oriented application 220. The weight for each branch may be updated (e.g., increased) when taken such that more frequently taken branches are assigned higher weights. Each entry of the table or data structure may correspond to a particular instance when a branch was taken. Each entry may also indicate the corresponding updated weight for that branch due to the branch being taken at that instance. As will be described in further detail below, the table or data structure may also include a time indicating when the branch was taken (e.g., a time record).

The method of FIG. 3 also includes updating 404 one or more corresponding logging levels for one or more branches of the plurality of branches. Updating 404 the one or more corresponding levels may be performed at least by the assignment module 204. In some embodiments, an indicator value may be calculated for each branch based on various data points, as will be described in further detail below, from which the logging levels for each branch may be determined. In some embodiments, such indicator values may be based on a predictive analysis of each branch, including a predictive analysis of the weights for each branch. Accordingly, in some embodiments, updating 404 one or more corresponding logging levels for one or more branches of the plurality of branches may include generating 406 a time-series model 260. Generating 406 the time-series model 260 may be performed by the prediction module 208 of FIG. 2.

The time-series model 260 may include a time-series prediction for each branch, including a time-series prediction for weights for that branch. For example, using the data describing activity of the object-oriented application 220 described above, a time-series model 260 for the weights for each branch may be generated. The time-series model 260 may be generated with respect to a particular number of cycles (e.g., a particular number of instances of executing that branch) in the future such that at N cycles in the future a corresponding weight for that branch may be predicted. As will be described in further detail below, the time-series model 260 may also include predicted time records for some number of cycles in the future.

In some embodiments, updating 404 the one or more corresponding logging levels for one or more branches of the plurality of branches may also include calculating 408, for each branch of the plurality of branches, a corresponding indicator value. An indicator value is a score or quantitative evaluation for that branch based on information such as predicted and/or recorded weights and/or time records for that branch as indicated in the time-series model 260. The indicator value may be calculated according to a variety of approaches based on particular design considerations.

As an example an indicator value (i.e., Ibranch-future) in the future after N cycles may be defined as:

Where Wn is the weight at future cycle n and Ubranch-n is the updated time at future cycle n.

The indicator values for each branch may then be used to update one or more of the logging levels 240 for the branches of the object-oriented application 240. Accordingly, in some embodiments, updating 404 the one or more corresponding logging levels for one or more branches of the plurality of branches may also include determining 410 (e.g., by the assignment module 204), for each branch of the plurality of branches, the corresponding logging level 240 based on the corresponding indicator value. Where the determined 410 logging level 240 for a particular branch differs from the currently assigned logging level, the logging level 240 for that particular branch is then updated to reflect the determined 410 logging level 240. As an example, each logging level 240 may correspond to a particular range of indicator values. A logging level 240 for a particular branch may be determined 410 as corresponding to the range of indicator values into which the indicator value of the particular branch falls.

For further explanation, FIG. 5 sets forth a flowchart of an example method of controlling application logging in accordance with some embodiments of the present disclosure. The method of FIG. 5 is similar to FIG. 4 in that the method of FIG. 5 also includes: generating 302 a tree structure 230 comprising a plurality of nodes and a plurality of branches defining relationships between classes of an object-oriented application 220, including assigning 304, to each branch of a plurality of branches in the tree structure 230, a weight based on a degree to which a corresponding relationship is identified in the object-oriented application 220; assigning 306, based on the weight for each branch of the plurality of branches, a corresponding logging level 240 to each branch of the plurality of branches; updating 402 the weight for each branch of the plurality of branches based on data describing activity of the object-oriented application 220 during execution of the object-oriented application 220; and updating 404 one or more corresponding logging levels for one or more branches of the plurality of branches, including: generating 406 a time-series model; calculating 408, for each branch of the plurality of branches, a corresponding indicator value; and determining 410, for each branch of the plurality of branches, the corresponding logging level 240 based on the corresponding indicator value.

The method of FIG. 5 differs from FIG. 4 in that the method of FIG. 5 also includes calculating 502, for each branch of the plurality of branches and based on the data describing activity of the object-oriented application 220 during execution of the object-oriented application 220, one or more time records. Calculating 502 the one or more time records may be performed by the monitoring module 206. A time record indicates when a particular branch of the object-oriented application 220 was taken. Accordingly, each time a particular branch of the object-oriented application 220 is taken, an entry in the data describing activity of the object-oriented application 220 may be created that indicates when that branch was taken. In other words, where the data describing activity of the object-oriented application 220 includes multiple entries describe multiple instances where a given branch was encountered, each entry may include a corresponding time record indicating when that particular instance occurred.

The time records for a given branch may then be used in updating 404 the corresponding logging levels for the one or more branches of the plurality of branches. For example, the time series model may be generated 406 to include predicted time records for each branch indicating predicted times at which the corresponding branch will be executed. These predicted time records may then be used in 408 calculating the indicator values for each branch, which may subsequently be used in determining 410 the corresponding logging levels 240 for each branch.

For further explanation, FIG. 6 sets forth a flowchart of an example method of controlling application logging in accordance with some embodiments of the present disclosure. The method of FIG. 6 is similar to FIG. 4 in that the method of FIG. 6 also includes: generating 302 a tree structure 230 comprising a plurality of nodes and a plurality of branches defining relationships between classes of an object-oriented application, including assigning 304, to each branch of a plurality of branches in the tree structure 230, a weight based on a degree to which a corresponding relationship is identified in the object-oriented application 220; assigning 306, based on the weight for each branch of the plurality of branches, a corresponding logging level to each branch of the plurality of branches; updating 402 the weight for each branch of the plurality of branches based on data describing activity of the object-oriented application 220 during execution of the object-oriented application 220; and updating 404 one or more corresponding logging levels for one or more branches of the plurality of branches, including: generating 406 a time-series model; calculating 408, for each branch of the plurality of branches, a corresponding indicator value; and determining 410, for each branch of the plurality of branches, the corresponding logging level based on the corresponding indicator value.

The method of FIG. 6 differs from FIG. 4 in that the method of FIG. 6 also includes determining 602, for each branch of the plurality of branches, a degree of thrown exceptions. Determining 602 the degree of thrown exceptions may be performed by the monitoring module 206 of FIG. 2. For a given branch, a degree of thrown exceptions may include a number of times a branch resulted in an exception within a particular time window, a frequency at which exceptions are thrown within a particular time window, or some other value reflecting a degree to which a particular branch results in an exception being thrown. For example, when a given method throws an exception during execution, information indicating the exception was thrown may be stored in association with the branches for that method. Continuing with the example A-M1 above, should an error be thrown, information indicating that an error was thrown may be stored in association with branches linking class A to classes C and B, or to branches linking class A to attributes C-a1 and B-a1, depending on the particular encoding schema used. The indicator values for those branches may be modified based on their associated degrees to which exceptions were thrown. For example, indicator values may be scaled or weighted, or be modified where degrees to which exceptions were thrown exceeds a threshold. This allows branches that may be less frequently taken but have higher degrees of exceptions to be assigned a higher logging level 240. Conversely, more frequently taken branches with low degrees of exception may be assigned a lower logging level 240.

For further explanation, FIG. 7 sets forth a flowchart of an example method of controlling application logging in accordance with some embodiments of the present disclosure. The method of FIG. 7 is similar to FIG. 4 in that the method of FIG. 7 also includes: generating 302 a tree structure 230 comprising a plurality of nodes and a plurality of branches defining relationships between classes of an object-oriented application, including assigning 304, to each branch of a plurality of branches in the tree structure 230, a weight based on a degree to which a corresponding relationship is identified in the object-oriented application 220; assigning 306, based on the weight for each branch of the plurality of branches, a corresponding logging level 240 to each branch of the plurality of branches; updating 402 the weight for each branch of the plurality of branches based on data describing activity of the object-oriented application 220 during execution of the object-oriented application 220; and updating 404 one or more corresponding logging levels 240 for one or more branches of the plurality of branches, including: generating 406 a time-series model; calculating 408, for each branch of the plurality of branches, a corresponding indicator value; and determining 410, for each branch of the plurality of branches, the corresponding logging level 240 based on the corresponding indicator value.

The method of FIG. 7 differs from FIG. 4 in that the method of FIG. 7 also includes applying 702 one or more filtering operations to the plurality of branches. Applying 702 the one or more filtering operations may be performed by the assignment module 204. The one or more filtering operations serve to subdivide the branches into multiple groups. As an example, in some embodiments, applying 702 the one or more filtering operations may include clustering the branches based on their respective weights and/or time records. As another example, in some embodiments, applying 702 the one or more filtering operations may include selecting, as a filter group, those branches having an aggregate (e.g., average or other aggregate value) time record and/or weight below a predefined threshold. One or more of the groups defined by the filtering operation may then have a default logging level assigned or be excluded from generating the time-series model 260 described above, thereby improving overall performance.

In view of the explanations set forth above, readers will recognize that the benefits of controlling application logging according to embodiments of the present invention include improved performance of a computing system by allowing for dynamically determined and variable logging levels for different execution paths in an object-oriented application. Exemplary embodiments of the present invention are described largely in the context of a fully functional computer system for controlling application logging. Readers of skill in the art will recognize, however, that the present invention also may be embodied in a computer program product disposed upon computer readable storage media for use with any suitable data processing system. Such computer readable storage media may be any storage medium for machine-readable information, including magnetic media, optical media, or other suitable media. Examples of such media include magnetic disks in hard drives or diskettes, compact disks for optical drives, magnetic tape, and others as will occur to those of skill in the art. Persons skilled in the art will immediately recognize that any computer system having suitable programming means will be capable of executing the steps of the method of the invention as embodied in a computer program product. Persons skilled in the art will recognize also that, although some of the exemplary embodiments described in this specification are oriented to software installed and executing on computer hardware, nevertheless, alternative embodiments implemented as firmware or as hardware are well within the scope of the present invention.