Skip to content

Logging

Squizy provides a structured logging system that captures HTTP request/response details for all entity operations.

How It Works

The SquizyLoggingFilter intercepts all HTTP requests to entity endpoints and logs:

  • Request: URI, HTTP method, headers, body
  • Response: status code, headers, body
  • Metadata: user email, total processing time in milliseconds

Log level rules:

  • Successful requests: INFO or DEBUG based on configuration
  • Error responses (status ≥ 300): always logged at ERROR level

Configuration

Default Logged Actions

Configure which operations are logged at INFO level for all entities:

properties
squizy.logging.default-logged-actions=CREATE,UPDATE,DELETE

Allowed values: READ, CREATE, UPDATE, DELETE. By default, no actions are logged at INFO level — everything goes to DEBUG.

Per-Entity Log Level

Override the default for specific entities:

properties
# Log all operations for orders at INFO level
squizy.logging.entity-logged-actions.order=READ,CREATE,UPDATE,DELETE

# Only log deletes for products
squizy.logging.entity-logged-actions.product=DELETE

The entity name is the lower-case version of the entity class name as registered by Squizy.

Ignored Paths

Certain paths can be excluded from logging entirely:

properties
squizy.server.logging-ignored-paths=/actuator/health,/actuator/prometheus

By default, the following paths are excluded:

PathReason
/actuator/healthHealth check endpoint (called frequently by orchestrators)
/actuator/prometheusMetrics scraping endpoint (called frequently by monitoring tools)

Log Format

Squizy uses structured logging via Logstash Logback Encoder:

json
{
  "message": "Request registered",
  "user": "[email protected]",
  "request": {
    "uri": "http://localhost:8080/api/product",
    "method": "POST",
    "headers": { "content-type": "application/json" },
    "body": "{\"reference\":\"AB-001\",\"name\":\"Headphones\"}"
  },
  "response": {
    "status": 200,
    "headers": {},
    "body": "{...}"
  },
  "totalMilliseconds": 42
}