Search

US-20260127089-A1 - DYNAMIC RUNTIME BEHAVIOR MODIFICATION FOR SESSION-SPECIFIC LOGGING

US20260127089A1US 20260127089 A1US20260127089 A1US 20260127089A1US-20260127089-A1

Abstract

Systems and methods described herein relate to runtime behavior modification for session-specific logging in the context of a software application. According to some examples, a system detects that session-specific logging is to be applied for a session of a software application. In response to detecting that session-specific logging is to be applied, the system enables the session-specific logging by dynamically adapting one or more original logging functions of the software application to provide one or more augmented logging functions. The software application is executed with the one or more augmented logging functions. As a result, session-specific logging is performed during the session to capture and store log data corresponding to a session-specific log level.

Inventors

  • Tom Spiegler

Assignees

  • SAP SE

Dates

Publication Date
20260507
Application Date
20241107

Claims (20)

  1. 1 . A system comprising: at least one memory that stores instructions; and one or more processors configured by the instructions to perform operations comprising: detecting that session-specific logging is to be applied for a session of a software application; in response to detecting that the session-specific logging is to be applied, enabling the session-specific logging by dynamically adapting one or more original logging functions of the software application to provide one or more augmented logging functions; executing the software application with the one or more augmented logging functions, thereby performing session-specific logging to capture log data corresponding to a session-specific log level during the session; and storing the log data.
  2. 2 . The system of claim 1 , wherein the one or more augmented logging functions add the session-specific logging to default logging associated with the one or more original logging functions, and the executing of the software application with the one or more augmented logging functions comprises: performing the default logging at a global log level associated with the one or more original logging functions in addition to performing the session-specific logging at the session-specific log level.
  3. 3 . The system of claim 2 , wherein the log data comprises first log data stored at a first storage location, the default logging is performed to capture second log data corresponding to the global log level, and the operations further comprise: storing the second log data at a second storage location that differs from the first storage location.
  4. 4 . The system of claim 2 , wherein the session-specific log level is an increased log level relative to the global log level.
  5. 5 . The system of claim 2 , wherein the session-specific log level is a TRACE log level, a DEBUG log level, or an INFO log level.
  6. 6 . The system of claim 1 , wherein the adapting of the one or more original logging functions comprises dynamically replacing the one or more original logging functions with the one or more augmented logging functions at runtime, the one or more augmented logging functions maintaining behavior of the one or more original logging functions and adding additional behavior to enable the session-specific logging.
  7. 7 . The system of claim 6 , wherein the one or more original logging functions comprise a plurality of original logging functions, each of the plurality of original logging functions being associated with a logging call for a respective log level, and the operations comprise dynamically replacing each of the plurality of original logging functions.
  8. 8 . The system of claim 1 , the operations comprising: in response to detecting that the session-specific logging is to be applied, instantiating a session-specific logging component to: provide the one or more augmented logging functions; and receive logging calls to capture the log data.
  9. 9 . The system of claim 8 , wherein the session-specific logging component intercepts the logging calls directed to an original logging component associated with the one or more original logging functions.
  10. 10 . The system of claim 1 , the operations further comprising: automatically integrating the log data with performance profile data of the software application.
  11. 11 . The system of claim 10 , wherein the performance profile data provides a hierarchical view reflecting an execution stack.
  12. 12 . The system of claim 1 , the operations further comprising: receiving, from a computing device, a request indicating that the session-specific logging is to be applied, wherein the detecting that the session-specific logging is to be applied is based on the request.
  13. 13 . The system of claim 12 , wherein the request comprises a parameter indicating that the request is to be run at the session-specific log level.
  14. 14 . The system of claim 12 , wherein the request is received at a server and originates from a client device associated with a user of the software application.
  15. 15 . A computer-implemented method performed by a computer system comprising a memory and at least one hardware processor, the computer-implemented method comprising: detecting that session-specific logging is to be applied for a session of a software application; in response to detecting that the session-specific logging is to be applied, enabling the session-specific logging by dynamically adapting one or more original logging functions of the software application to provide one or more augmented logging functions; executing the software application with the one or more augmented logging functions, thereby performing session-specific logging to capture log data corresponding to a session-specific log level during the session; and storing the log data.
  16. 16 . The computer-implemented method of claim 15 , wherein the one or more augmented logging functions add the session-specific logging to default logging associated with the one or more original logging functions, and the executing of the software application with the one or more augmented logging functions comprises: performing the default logging at a global log level associated with the one or more original logging functions in addition to performing the session-specific logging at the session-specific log level.
  17. 17 . The computer-implemented method of claim 16 , wherein the log data comprises first log data stored at a first storage location, the default logging is performed to capture second log data corresponding to the global log level, and the computer-implemented method further comprises: storing the second log data at a second storage location that differs from the first storage location.
  18. 18 . One or more non-transitory computer-readable media storing computer-executable instructions that, when executed by a computing system, cause the computing system to perform operations comprising: detecting that session-specific logging is to be applied for a session of a software application; in response to detecting that the session-specific logging is to be applied, enabling the session-specific logging by dynamically adapting one or more original logging functions of the software application to provide one or more augmented logging functions; executing the software application with the one or more augmented logging functions, thereby performing session-specific logging to capture log data corresponding to a session-specific log level during the session; and storing the log data.
  19. 19 . The one or more non-transitory computer-readable media of claim 18 , wherein the one or more augmented logging functions add the session-specific logging to default logging associated with the one or more original logging functions, and the executing of the software application with the one or more augmented logging functions comprises: performing the default logging at a global log level associated with the one or more original logging functions in addition to performing the session-specific logging at the session-specific log level.
  20. 20 . The one or more non-transitory computer-readable media of claim 19 , wherein the log data comprises first log data stored at a first storage location, the default logging is performed to capture second log data corresponding to the global log level, and the operations further comprise: storing the second log data at a second storage location that differs from the first storage location.

Description

TECHNICAL FIELD The subject matter disclosed herein generally relates to logging in a software application context. More specifically, but not exclusively, the subject matter relates to the dynamic adaptation of logging functionality to selectively enable enhanced debugging or analysis capabilities. BACKGROUND In a software application context, “logging” refers to a process of capturing information about an application's state, operations, issues, or events that occur during runtime. Software developers commonly use logging for purposes such as debugging, performance monitoring, or application behavior analysis. Log levels in software applications typically define the granularity or importance of information captured during logging. These levels can range from less severe (e.g., TRACE or DEBUG) to more severe (e.g., ERROR or FATAL), allowing developers to control the verbosity of log output and filter logs based on their type. In various implementations, the log level is set globally, at a system-wide level. This global log level is often set at a relatively low level (e.g., a less verbose level, such as ERROR), which can result in technical challenges when it becomes necessary to debug specific issues or capture more detailed logs for particular features, sessions, or requests. For example, increasing the global log level for such purposes can cause excessive or complex log generation or degrade system performance. BRIEF DESCRIPTION OF THE DRAWINGS Some examples are shown for purposes of illustration and not limitation in the figures of the accompanying drawings. In the drawings, which are not necessarily drawn to scale, like numerals may describe similar components in different views or examples. To identify the discussion of any particular element or act more easily, the most significant digit or digits in a reference number refer to the figure number in which that element is first introduced. FIG. 1 is a diagrammatic representation of a network environment, according to some examples. FIG. 2 is a block diagram of certain components of an application, according to some examples. FIG. 3 is a flowchart illustrating operations of a method for implementing session-specific logging, according to some examples. FIG. 4 is a swimlane flowchart illustrating operations performed by respective components of an application, wherein the application implements session-specific logging, according to some examples. FIG. 5 is a table illustrating performance profile data for an application, wherein session-specific logging output is integrated into the performance profile data. FIG. 6 is a block diagram showing a software architecture for a computing device, according to some examples. FIG. 7 is a block diagram of a machine in the form of a computer system, according to some examples, within which instructions may be executed for causing the machine to perform any one or more of the methodologies discussed herein. DETAILED DESCRIPTION When an issue arises within a software application, it may be possible to investigate and diagnose the issue directly on a user's computer system. However, diagnostic tools on the user's computer system may be limited when compared to what is available on a developer's computer system. It may also be undesirable to involve the user or their computer system in this process. Accordingly, it is often desirable for a developer to investigate or diagnose issues locally in a developer environment. In some cases, a developer may replay a user's issue locally on the developer's computer system to investigate the root cause of the issue. However, this can be technically challenging, for example, due to the developer lacking privileges for certain operations, restrictions in transferring content from the user, or failures in transferring all relevant information to the developer environment. An alternative approach to this developer-user interaction is to generate server traces in sufficient detail to enable developers to investigate or diagnose issues. However, as mentioned, a log level associated with an application is often set globally. In other words, the application is unable to dynamically adjust the log level for individual server requests to provide a desired level of logging only for those individual requests. The global log level is often set conservatively, such as at an ERROR level. This means that only messages that are flagged with ERROR, or an even more conservative log level, are captured. Changing the log level system-wide to a more detailed level (e.g., to a DEBUG level) may result in various technical challenges and may even require a system restart. These technical challenges can include excessive log generation (since a more fine-grained log level applies to all incoming requests), overloading a log database, or complicating the logs that are of interest. When too many log entries are being generated, older logs may be removed due to log rotation or log size limitations. Further