Implement a robust structured logging mechanism in your application utilizing the tracing and opentelementry libraries. This setup will facilitate meaningful log entries that can be leveraged for debugging, monitoring, and performance analysis.
Requirements:
• Logging Configuration: Configure tracing to enable structured logging, ensuring logs are serialized in JSON format for easier parsing.
• Log Capture: All incoming HTTP requests must be logged, capturing both the HTTP method (e.g., GET, POST) and the request path
Acceptance Criteria:
- Log Format: Ensure each log entry includes:
• Timestamp of when the request was received.
• Log level indicating the severity of the log (INFO, WARN, ERROR).
• The HTTP method and path formatted clearly for quick analysis.
- Level of Detail: At the INFO level, log details about successful requests including:
• Response status code and any relevant metadata.
- Error Handling: For WARN and ERROR levels, capture:
• Detailed error messages, stack traces, and any debugging information necessary for troubleshooting.
Implement a robust structured logging mechanism in your application utilizing the
tracingand opentelementry libraries. This setup will facilitate meaningful log entries that can be leveraged for debugging, monitoring, and performance analysis.Requirements:
• Logging Configuration: Configure
tracingto enable structured logging, ensuring logs are serialized in JSON format for easier parsing.• Log Capture: All incoming HTTP requests must be logged, capturing both the HTTP method (e.g., GET, POST) and the request path
Acceptance Criteria:
• Timestamp of when the request was received.
• Log level indicating the severity of the log (INFO, WARN, ERROR).
• The HTTP method and path formatted clearly for quick analysis.
• Response status code and any relevant metadata.
• Detailed error messages, stack traces, and any debugging information necessary for troubleshooting.