Application-Specific Log Routing via Thread Context
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional logging systems route all log messages from applications and server dependencies to the default server context, making it difficult to distinguish and route log messages to the appropriate context, especially when multiple deployments depend on the same custom module, leading to inefficiencies and increased system latency.
Innovation Solution
Implementing a log router that identifies the thread context of log messages and routes them to the corresponding logger, creating a new logger if necessary, allowing for efficient routing of log messages to their appropriate contexts, thereby enhancing performance and reducing latency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If all log messages are routed to the default server context, then logging simplicity is maintained, but log message differentiation and routing efficiency deteriorate
Solution Approach 1:
The patent segments log routing by introducing thread context identification, dividing the monolithic default server context into multiple deployment-specific contexts. Each thread is associated with a specific deployment context, enabling logs to be automatically routed to the appropriate context based on the thread's context, thus improving routing efficiency while maintaining logging simplicity through automated context determination.
2Adaptability or versatility
If multiple deployments share the same custom module, then resource utilization is improved, but log message differentiation becomes difficult
Solution Approach 1:
The patent applies local quality by associating each thread with a specific deployment context, giving each thread a unique local identity despite sharing common resources like custom modules. When a log message is generated, the system identifies the thread context and routes the log to the corresponding deployment-specific context, ensuring that log messages are differentiated by their source deployment even when multiple deployments share the same custom module.
3Measurement precision
If log messages are routed to deployment-specific contexts, then log routing precision is improved, but system complexity increases
Solution Approach 1:
The patent implements self-service by having the logging system automatically determine and use the thread context for routing log messages. The system retrieves the thread context from the thread object itself without requiring external configuration or manual intervention, thus achieving precise deployment-specific log routing while minimizing the increase in system complexity through automated context determination.
Data Source
AI summary
Implementations for application-specific log routing are described. An example method may include receiving, by an application server, a log message; responsive to determining that a log router associated with the application server is enabled, identifying a thread context associated with an execution thread that created the log message; responsive to identifying a logger associated with the thread context, forwarding the log message to the logger; and processing the log message by the logger.


