Bird
0
0

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:
  1. Step 1: Identify standard log formats

    JSON format is widely used for structured logs in microservices for easy parsing and querying.
  2. 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.
  3. Final Answer:

    {"timestamp": "2024-06-01T12:00:00Z", "level": "ERROR", "message": "Failed to connect"} -> Option B
  4. Quick Check:

    Structured JSON logs = {"timestamp": "2024-06-01T12:00:00Z", "level": "ERROR", "message": "Failed to connect"} [OK]
Quick Trick: Logs are best as structured JSON for easy use [OK]
Common Mistakes:
MISTAKES
  • Using unstructured plain text logs
  • Confusing XML-like logs with JSON
  • Ignoring timestamp or level fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes