Skip to content

Logging Attributes

Logging attributes provide declarative logging for cross-cutting entry points such as application services, handlers, retrievers, processors, and domain operations.

Purpose

Use attribute-driven logging to:

  • standardize method entry/exit logs;
  • capture duration and outcome;
  • avoid repetitive logging boilerplate;
  • attach consistent module or operation names;
  • support observability without coupling business code to a logging provider.

Design Rules

  • Attributes should describe logging intent, not provider-specific behavior.
  • Sensitive arguments and return values must be excluded or redacted.
  • Failure logging must preserve exceptions and correlation context.
  • Attribute behavior must be testable without requiring a concrete logging sink.

Template Responsibilities

BaseTemplate should document the concrete attributes, interception mechanism, registration path, and tests. Layer 3 templates should document only additional attributes or domain-specific operation naming conventions.