mastra-ai/mastra · error · MastraError

OBSERVABILITY_STORAGE_LIST_LOGS_NOT_IMPLEMENTED

OBSERVABILITY_STORAGE_LIST_LOGS_NOT_IMPLEMENTED

Error message

This storage provider does not support listing logs

What it means

This error is thrown by the base MastraObservabilityStorage class's listLogs method, a default implementation that always throws. It means the storage provider does not implement querying/listing log records with optional filters. The library throws to make the missing capability explicit rather than returning an empty result, which would silently hide the fact that logs were never stored or cannot be read.

Source

Thrown at packages/core/src/storage/domains/observability/base.ts:416

  // ============================================================================

  /**
   * Creates multiple log records in a single batch.
   */
  async batchCreateLogs(_args: BatchCreateLogsArgs): Promise<void> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_BATCH_CREATE_LOGS_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support batch creating logs',
    });
  }

  /**
   * Retrieves a list of logs with optional filtering.
   */
  async listLogs(_args: ListLogsArgs): Promise<ListLogsResponse> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_LIST_LOGS_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support listing logs',
    });
  }

  // ============================================================================
  // Metrics
  // ============================================================================

  /**
   * Creates multiple metric observations in a single batch.
   */
  async batchCreateMetrics(_args: BatchCreateMetricsArgs): Promise<void> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_BATCH_CREATE_METRICS_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Switch to a storage provider that implements listLogs (a database-backed provider with log support).
  2. Check the provider's capabilities before building log UI/API features on top of it.
  3. If you own the provider, override listLogs to query stored log records with the provided filters.
  4. In UI/API code, catch this error and render a 'logs not supported by this storage provider' state instead of crashing.

Example fix

// before
const logs = await storage.listLogs({ fromDate, toDate });
// after
let logs;
try {
  logs = await storage.listLogs({ fromDate, toDate });
} catch (e) {
  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_LIST_LOGS_NOT_IMPLEMENTED') {
    logs = { logs: [], total: 0, unsupported: true };
  } else {
    throw e;
  }
}
Defensive patterns

Strategy: try-catch

Validate before calling

const supportsListLogs = typeof storage.listLogs === 'function' && storage.listLogs !== MastraObservabilityStorage.prototype.listLogs;
if (!supportsListLogs) { /* disable the log viewer / return an empty response */ }

Type guard

function supportsListLogs(s: unknown): s is MastraObservabilityStorage & { listLogs: (a: ListLogsArgs) => Promise<ListLogsResponse> } {
  return s instanceof MastraObservabilityStorage && (s as any).listLogs !== MastraObservabilityStorage.prototype.listLogs;
}

Try / catch

try {
  const logs = await storage.listLogs(args);
} catch (e) {
  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_LIST_LOGS_NOT_IMPLEMENTED') {
    return { logs: [], total: 0 } as ListLogsResponse;
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling storage.listLogs(args) (ListLogsArgs) on a provider that inherits the base default, e.g. the log viewer in Studio or an API route fetching logs with date/level filters.

Common situations: Browsing logs in the Mastra Studio UI while connected to a storage adapter without log support; querying logs through a custom API endpoint; using a storage backend where the logs domain was never implemented; mistakenly treating the base class as a usable provider.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/5c76b885940ef1fd. Report an issue: GitHub.