Core Features
- Persistent Logging: Automatically saves detailed information about each API request, including input, output, status, latency, and cost.
- Multiple Backend Support: Comes with built-in support for SQLite, PostgreSQL, and ClickHouse, allowing you to choose the best storage solution for your deployment needs.
- Rich Querying and Filtering: A powerful search API allows you to filter and sort logs based on a wide range of criteria such as provider, model, status, latency, cost, and content.
- Performance Analytics: The search functionality also provides aggregated statistics, including total requests, success rate, average latency, total tokens, and total cost for the queried data.
- Structured Data Model: Logs are stored in a structured format, with complex objects like message history and tool calls serialized as JSON for efficient storage and retrieval.
- Automatic Data Management: Includes GORM hooks to automatically handle JSON serialization/deserialization and to build a searchable content summary.
Architecture
The LogStore is built around theLogStore interface, which defines the standard methods for interacting with the log database. The primary implementation, RDBLogStore, uses GORM to provide an abstraction over relational databases.
Supported Backends
- SQLite: The default, file-based database, ideal for local development and smaller, single-node deployments.
- PostgreSQL: A production-ready database for scalable and high-availability deployments.
- ClickHouse: A column-oriented database for high-volume log storage and analytics.
Hiding request types from the dashboard
Setclient.hidden_request_types to an array of request type strings in config.json:
storage.logsStore.hiddenRequestTypes:
config.json changed, the file value is applied; when it is unchanged, edits made in the
UI are kept.
This setting hides matching log rows from the dashboard and log read APIs, including
pagination counts, statistics, charts, rankings, session details, and filter options.
A direct lookup of a hidden log returns not found. All requests continue to be logged
in the database; logging, retention, deletion, and cost recalculation are unchanged.
MCP tool logs are unaffected.
Use exact request type values, such as count_tokens, embedding, chat_completion,
chat_completion_stream, responses, or responses_stream. Streaming and
non-streaming types are separate. An omitted or empty array shows all request types.
The setting works with SQLite, PostgreSQL, and ClickHouse, including object storage
for log payloads.
Initialization
The LogStore is initialized at startup based on the provided configuration.LogStore:
PostgreSQL databases used by Bifrost stores must be UTF8 encoded. See PostgreSQL UTF8 Requirement.
Connection Pool Configuration
For PostgreSQL backends, you can configure the database connection pool to optimize performance based on your workload:- MaxIdleConns: Maximum number of idle connections in the pool (default: 5)
- MaxOpenConns: Maximum number of open connections to the database (default: 50)
Data Model
The core of the LogStore is theLog struct, which represents a single log entry in the logs table.
Usage
Creating Log Entries
A log entry is created by populating aLog struct and passing it to the Create method. This is typically handled internally by Bifrost’s logging plugins.
Searching and Filtering Logs
TheSearchLogs method provides a powerful way to query logs with fine-grained filters and pagination.

