Which syntax correctly represents a log entry in a microservice system?
easy📝 Conceptual Q12 of 15
Microservices - Monitoring and Observability
Which syntax correctly represents a log entry in a microservice system?
A[2024-06-01 12:00:00] ERROR Failed to connect
B{"timestamp": "2024-06-01T12:00:00Z", "level": "ERROR", "message": "Failed to connect"}
C<log time='2024-06-01T12:00:00Z' level='ERROR'>Failed to connect</log>
DERROR 2024-06-01T12:00:00Z Failed to connect
Step-by-Step Solution
Solution:
Step 1: Identify standard log formats
JSON format is widely used for structured logs in microservices for easy parsing and querying.
Step 2: Compare options for correctness
{"timestamp": "2024-06-01T12:00:00Z", "level": "ERROR", "message": "Failed to connect"} is a valid JSON log entry with timestamp, level, and message fields. Others are less structured or not JSON.
Final Answer:
{"timestamp": "2024-06-01T12:00:00Z", "level": "ERROR", "message": "Failed to connect"} -> Option B