1.2 KiB
Logging
The current Django configuration logs to stdout/stderr only. It defines one
verbose formatter and a console handler; there are no file handlers, rotation or
JSON formatter in settings.py.
Configured loggers include documents, communications,
api.v1.communications, notifications, requests_app, employees, common,
django, django.contrib.auth, eusrr_backend.auth_backends and ldap3.
Several legacy modules still log at DEBUG regardless of DEBUG, so production
log volume must be reviewed at deployment time.
Use standard module loggers:
import logging
logger = logging.getLogger(__name__)
logger.info("operation completed", extra={"object_id": object_id})
logger.exception("operation failed")
Never log passwords, JWTs, LDAP bind credentials, Web Push keys, complete query strings containing tokens or unrestricted notification payloads. Prefer stable event names and identifiers over interpolated personal data.
Production collection, retention, redaction and alerting belong to the runtime
platform. If JSON logging or Sentry is introduced, update LOGGING and this guide
in the same change; do not document handlers that are not configured.