Empower Logging Standard
Logger Initialization:
- Use a structured logger like Structlog.
- Initialize the logger at the beginning of the application.
- Configure logging settings based on environment variables if needed.
Logging Configuration:
- Define log levels based on the severity of the events. DEBUG has full calling detail for the authoring team. Ideal but not required
 INFO has rough flow of details. Ideal but not required. WARNING has anything that registers that it could be a problem soon or isn’t secure. Required.
 ERROR has any events that directly leads to failures in logic and programming. Required.
OpenTelemetry Integration:
- Integrate OpenTelemetry for distributed tracing and observability.
Datadog Logging Processor:
- Implement custom log processors for specific Datadog support.
- Specifically: “trace_id” and “span_id” should be maintained and passed to Datadog.
Django Integration:
- Integrate with Django framework, if applicable to your workload, for tracing and logging.
- Configure Django instrumentation to include SQL query tracing as well as any related logic.
Environmental Configuration:
- Set environment variables for controlling logging behavior, such as log levels and formatter selection.
- Built in Logging conditional for “Platform Logging” vs. “ Local Developer Logging” should be controlled via Environment Variables.
Log Formatting:
- Use JSON formatting for all logging, for better readability and parsing.
- Include contextual information such as logger name, log level, timestamps, and stack traces, as available.
- Any secret related information should be removed from the logging. If removal is not possible, obscuring values with ‘*’ characters is also acceptable.
Standardization:
- The above standards should be followed as closely as possible, across all languages and frameworks.