Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / operations/logs / getRecentLogs

Function: getRecentLogs()

getRecentLogs(instance, options): Promise<LogEntry[]>

Defined in: packages/b2c-tooling-sdk/src/operations/logs/tail.ts:535

Gets recent log entries (one-shot retrieval).

Useful for MCP server integration or programmatic access without continuous tailing. Reads the tail end of log files and returns parsed entries.

Parameters

instance

B2CInstance

B2C instance to get logs from

options

GetRecentLogsOptions = {}

Retrieval options

Returns

Promise<LogEntry[]>

Array of recent log entries

Example

typescript
// Get the last 50 error entries
const entries = await getRecentLogs(instance, {
  prefixes: ['error'],
  maxEntries: 50
});

Released under the Apache-2.0 License.