Package net.commuty.parking.model
Class ApplicationLog
java.lang.Object
net.commuty.parking.model.ApplicationLog
The "ApplicationLog" serves as a structured representation of log data emitted by client applications utilizing this API.
It plays a crucial role in providing valuable insights and facilitating effective monitoring and troubleshooting within the application ecosystem.
Application logs hold significant importance as they offer key information to enhance developer experience and operational efficiency.
These logs are essential for various purposes, including but not limited to:
- Integration Validation: Determining the successful completion of integrations, such as synchronization processes with external systems, like access control systems.
- Discrepancy Detection: Identifying discrepancies or inconsistencies between multiple systems, such as disparities in access control configurations or user identifiers.
- Real-time Status Reporting: Conveying real-time information about the operational status of the client application, enabling developers to respond promptly to emerging issues or opportunities for improvement.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionApplicationLog(LocalDateTime timestamp, ApplicationLogLevel level, String type, String message, String applicationId, Map<String, Object> context) -
Method Summary
-
Field Details
-
TYPE_MAX_SIZE
public static final int TYPE_MAX_SIZE- See Also:
-
MESSAGE_MAX_SIZE
public static final int MESSAGE_MAX_SIZE- See Also:
-
APPLICATION_ID_MAX_SIZE
public static final int APPLICATION_ID_MAX_SIZE- See Also:
-
-
Constructor Details
-
ApplicationLog
public ApplicationLog(LocalDateTime timestamp, ApplicationLogLevel level, String type, String message, String applicationId, Map<String, Object> context)
-
-
Method Details
-
getTimestamp
- Returns:
- The "timestamp" property denotes the precise date and time (in Coordinated Universal Time - UTC) when the application log event occurred. This timestamp serves as a critical reference point for temporal analysis, ensuring accurate chronological sequencing of log entries.
-
getLevel
- Returns:
- The "level" property indicates the severity or significance of the application log entry. It serves as a classification mechanism that helps prioritize and categorize log messages for effective monitoring and troubleshooting. Other common levels (such as "debug" and "trace") are not included because this API is not intended to receive the entire set of logs of the client application. It only targets logs that must be shared with Commuty.
-
getType
- Returns:
- The "type" property serves as a categorization attribute within the application log entry, providing a high-level classification of the log message's purpose or nature. It aids in organizing and distinguishing log entries based on their broader context. While the "level" property indicates the severity of the log entry, the "type" property helps to further contextualize it. Examples of `type`: `user-synchronization`, `synchronization-failure`, `synchrozization-completed`, `performance-issue`
-
getMessage
- Returns:
- The "message" property represents the core content of the application log entry. It contains a detailed description or narrative of the event, providing valuable context, insights, or diagnostic information. The "message" serves as the primary textual payload of the log entry, conveying the essence of the logged event. Key Considerations: * The "message" property should be informative and concise, aiming to communicate the essential details of the event or situation. * It is a fundamental component of the log entry, enabling developers and operators to understand the nature of the event and take appropriate actions. * While other properties, such as "level," "type," and "timestamp," provide structured metadata, the "message" property offers the narrative that completes the log entry, aiding in effective debugging, monitoring, and analysis. Developers are encouraged to craft informative and context-rich messages within their log entries, as these messages play a pivotal role in enhancing the overall log readability and utility.
-
getApplicationId
- Returns:
- The "applicationId" property serves as a unique identifier associated with the client application generating the log entry. It plays a pivotal role in distinguishing log entries originating from different applications within the ecosystem. This identifier is valuable for tracking and attributing log events to specific application instances.
-
getContext
- Returns:
- The "context" property provides a flexible mechanism for including additional information, metadata, or contextual details relevant to the logged event. It serves as an extensible container for supplementary data, allowing developers to enrich log entries with custom key-value pairs or structured information that enhances the comprehensiveness of the log record. This is optional.
-
toString
-