Parent Integer
The Log Parent feature in LogHub allows you to group multiple logs under a single parent log, creating a comprehensive log trail that makes it easier to follow the flow of a process and all the events it produces. This feature is especially useful for understanding complex operations that generate multiple log entries, as it links related logs together in a meaningful way.
Key Features of Log Parent
- Log Grouping: By setting a Log Parent, any subsequent logs are appended to the parent log, effectively grouping them together. This creates a log trail that shows the progression of a process or operation, giving you a clear view of the steps involved and the logs generated at each stage.
- For example, a checkout process might involve logs for cart validation, payment processing, and order confirmation. By using a single Log Parent, all logs related to that checkout operation are grouped, making it easier to follow the entire flow.
- Overriding Log Types: In a parent-child log structure, the Log Type of the parent log is dynamically updated based on the logs that follow it. Specifically, if a child log has a more severe type (e.g., ERROR), it overrides the original type of the parent log.
- Example: If a parent log starts with several successful steps (SUCCESS), but a later child log encounters an error (ERROR), the entire parent log will be updated to reflect the ERROR type. This ensures that the log reflects the most important or critical outcome of the process.
- Clear Log Trails: The Log Parent feature makes it easy to visualize the sequence of events and identify where things go wrong. In the log trail, each log retains its original type, so you can see the exact point where an operation fails or deviates from the expected flow.
- You can see the initial successful logs, followed by the logs that generate warnings or errors, making it easy to pinpoint the failure point in the process.
- Simplified Error Handling: This feature is particularly useful in scenarios where complex processes involve multiple actions or checks. If any step in the sequence fails, the Log Parent automatically reflects this by updating the overall status, helping you focus on troubleshooting the error without manually reviewing each log entry.
The Log Parent feature helps you track the entire lifecycle of processes and actions within your project, creating a structured log trail. By appending related logs to a parent and overriding the parent’s type based on the most critical outcome, you can easily see where a process succeeds or fails, ensuring a more intuitive and comprehensive view of your application’s behavior.