Skip to main content

Overview

Every query, command, and API call that flows through Formal is logged and stored for auditing, compliance, and security analysis. Formal’s log system provides comprehensive visibility into data access across your organization. Logs can come from Connectors, the Formal Endpoint, the Control Plane, or workflows. Control Plane logs

Log Sources

Every log has a source field. Use the Source control in the Control Plane, or filter with Quickwit (for example source:control-plane). For Control Plane audit fields, search examples, and who can view those logs, see Control Plane Logs.

What Gets Logged

Database Queries

Full SQL/NoSQL queries, execution time, rows affected

API Calls

HTTP requests, headers, request/response bodies, status codes

SSH Commands

Every command executed in SSH sessions

Kubernetes Exec

kubectl exec sessions and commands

Control Plane API Calls

Create, Read, Update, and Delete API calls made to the Control Plane

Log Enrichment

Formal automatically enriches each Connector log entry with contextual information: Control Plane API calls are enriched with the following information: See Control Plane Logs for search examples and viewing permissions.

Accessing Logs

Navigate to Logs in the Control Plane to view all logged activity.

Viewing Modes

Default view that displays all log entries chronologically.
  • See individual queries/commands
  • Click any row to open detailed panel
  • Filter and search across all fields
  • Click Export to download CSV or JSON
To review only the requests that triggered policies, use the Triggered Policies tab on the Policies page. See Triggered Policies and Policy Suspensions.

Aggregation Examples

Use Aggregations to answer common operational and security questions:
Combine aggregation with time range filters to compare patterns across periods — for example, compare this week’s query volume to last week’s to spot anomalies.

Log Details Panel

Click any log entry to view comprehensive details: Log details panel

What’s Included

  • Full Query/Command: Complete text of what was executed
  • User Context: User, end-user, groups, email
  • Resource Information: Database, hostname, port, technology
  • Policy Evaluation: Which policies evaluated, actions taken, reasons
  • Performance Metrics: Duration, rows affected, data transferred
  • Network Information: Client IP, application, connection details
  • Session Link: Jump to associated session recording

Log Schema Reference

Every log entry follows a structured schema with nested fields. You can query any of these fields using Quickwit syntax.

Event and Session Fields

User Fields

Resource Fields

Request and Response Fields

Policy Fields

Connector and Space Fields

Control Plane Fields

See Control Plane Logs for the full audit schema, search examples, and viewing permissions.

Device Fields

Formal uses Quickwit query engine for powerful search capabilities.

Basic Filters

Use the sidebar to filter by:
  • Source — Connector, Control Plane, Workflow, or Endpoint
  • Connector
  • Resource
  • User
  • End-user
  • Group
  • Technology (postgres, ssh, http, etc.)
  • Time range
Source selects which log stream to search. Connector is the default. Endpoint covers traffic from the Formal Endpoint, such as LLM resources and SSH in Transparent Mode. Control Plane covers API audit logs from app.formal.ai, the public API, and Terraform; see Control Plane Logs. Who can open Logs (all sources) is controlled by the Logs application in Permissions. Write Quickwit queries for complex searches. Use the full field paths from the Log Schema Reference:
For relative windows, such as the last 24 hours, use the time range picker. Quickwit doesn’t support relative dates like now-24h in queries.

Query Templates

Formal provides pre-built query templates:

Query Library

Query actions Access your queries from the Logs toolbar:
  • Recent queries: Click the clock icon to reopen recent searches
  • Saved Queries: Open the query library (Templates and Saved tabs)

Recent Queries

View your search history:
  1. Click the clock icon next to Saved Queries
  2. Select any previous query to re-run it
  3. History persists across sessions

Saved Queries

Save frequently used queries for quick access:
  1. Create your query with filters or search terms
  2. Click Save Query in the toolbar
  3. Name your query
  4. Access later from Saved Queries → Saved

Template Queries

Pre-built queries for common use cases. Click Saved Queries → Templates to browse available templates (see Query Templates above)

Exporting Logs

CSV Export

Export search results to CSV for offline analysis:
  1. Apply filters or search query
  2. Click Export
  3. Choose CSV (or JSON), then download the file

Log Forwarding

Forward all logs to external systems:
  • AWS S3: Long-term archive, compliance storage
  • Datadog: Real-time monitoring and alerting
  • Splunk: SIEM integration
  • Panther: Custom.Formal.Logs schema
See Log Forwarding for setup instructions.

Log Schemas

Use log schemas to remove, encrypt, truncate, or sanitize selected fields before Formal stores or exports a log. Schemas support CEL scopes for Connector and Endpoint logs. See Log Schemas for supported paths, actions, restrictions, and Terraform examples.

Log Retention

For a summary of what each Formal component sends and stores, see Data Handling and Retention.

Activity Logs

Connector, Endpoint, Control Plane, and workflow logs are stored together in Formal’s Quickwit index and are available for as long as your account is active. For long-term archival or compliance requirements, use Log Forwarding to forward logs to:
  • AWS S3: Cost-effective long-term storage for compliance (e.g., 7-year SOC 2 retention)
  • Datadog: Real-time monitoring with configurable retention periods
  • Splunk: SIEM integration with custom retention policies

Policy Evaluation Input Retention

Policy evaluation inputs (the input data passed to policies) contain sensitive information and have a configurable retention period of 0 to 30 days. This data powers policy impact reports. Log Configurations can be used to configure retention independently for each evaluation stage: Retention can be scoped at multiple levels (in precedence order):
  1. Resource — per-resource override
  2. Connector — per-connector default
  3. Space — per-space default
  4. Account — organization-wide default
Each log configuration also has a Source. Connector applies to Connector logs. Endpoint applies to Formal Endpoint logs and always uses Account scope. You can also manage retention with the formal_log_configuration Terraform resource:
Valid durations are whole numbers of days from 0d (disabled) to 30d. To turn off retention for one resource while keeping your account default, add a configuration with scope { type = "resource" } and set each stage to 0d.
Setting retention to 0 days disables retention for that stage. Policy impact reports won’t have data to backtest against for disabled stages. Changes to retention settings may take up to a day to take effect.
Policy evaluation inputs may contain sensitive data depending on your policies. Retention is subject to a maximum of 30 days. Changing retention settings may take a day to take effect.

Best Practices

Save frequently used searches for compliance, security, or operational monitoring.
Forward logs to your SIEM or data lake for advanced analytics and long-term retention beyond the Control Plane.
Schedule weekly or monthly log reviews to identify unusual patterns, policy gaps, or security incidents.
Leverage aggregation and visualization to spot trends that aren’t obvious in individual log entries.
Regularly review logs where policies blocked or masked data to ensure policies are working as intended.

Policy Evaluation Input Retention

Formal can optionally retain the input data passed to policies during evaluation. This enables policy backtesting — testing new or modified policies against historical access patterns. Refer to policies evaluation docs for what is available as input at each stage. See Log Retention above for configuration details, scope hierarchy, and retention limits.

Integration with Policies

Policies can enrich logs with contextual information:
The reason and contextual_data fields appear in the log entry, providing audit trail context.

Troubleshooting

Check that traffic reached a Formal proxy. For Endpoint traffic, confirm that an active rule matched it. External destinations also require configured Log Forwarding.
Cause: Endpoint traffic appears in Logs only when an active rule matches it. A flow does not appear if it matches no pre_tcp condition, or if it matches pre_tls but not post_tls. Linux ignores pre_tcp.Fix: Set the rule to Active. Check each stage and confirm that the process or hostname matches. See network rule inputs.
Cause: Network rules select TCP traffic. QUIC uses UDP/443. Loopback traffic is not intercepted unless transparent_proxy.intercept_localhost is enabled.Fix: The transparent_proxy.allow_quic setting controls whether Transparent Mode allows QUIC. It does not make UDP traffic visible to TCP rules. Use a TCP route when you need inspection. Enable localhost interception only when you need to inspect loopback traffic. See Endpoint configuration.
Cause: Logs separates Connector, Endpoint, Control Plane, and workflow sources. Connector is the default source. Endpoint events use source:desktop.Fix: Select the source that handled the request and widen the time range. Search for source:desktop to find Endpoint traffic or source:connector to find Connector traffic.
Cause: Log configuration can retain session, request, and response policy-evaluation inputs for different durations. The event may remain after those inputs expire.Fix: Review the log configuration for the resource, Connector, Space, or account. Adjust the relevant policy-input retention setting if you need those details longer. See policy evaluation input retention.
Cause: If the Connector cannot reach the Control Plane, it continues with its last configuration and spools logs. A new instance cannot load its configuration until it reconnects.Fix: Check Connector readiness and Control Plane connectivity. Keep /formal/logs writable and persistent so buffered logs survive restarts. The Connector retries delivery after connectivity returns.
Cause: An external SIEM or object store receives logs only after you configure Log Forwarding. Formal forwards all logs by default, including Insights findings.Fix: Confirm that the integration is configured. Check the destination credentials, permissions, and source path. Object storage uses formal/logs/{source}/{year}/{month}/{day}/{file}.
Cause: Access to all log sources is controlled by the Logs application permission.Fix: Ask an administrator to grant Logs read access. A blocked Logs request returns HTTP 403.

Next Steps

Control Plane Logs

Audit API calls and restrict who can view logs

Sessions

View active and completed sessions

Permissions

Restrict access to the Logs application

Log Forwarding

Forward logs to your SIEM