liara_get_logs
Retrieve application logs from Liara cloud platform by specifying app name, time range, and entry limit for monitoring and debugging purposes.
Instructions
Get app logs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appName | Yes | The name of the app | |
| limit | No | Maximum number of log entries (optional, default: 100) | |
| since | No | ISO timestamp to fetch logs since (optional) | |
| until | No | ISO timestamp to fetch logs until (optional) |
Implementation Reference
- src/services/observability.ts:31-57 (handler)The core handler function that retrieves application logs from the Liara API using the provided appName and optional time range or limit parameters. This is the exact implementation of the liara_get_logs tool logic.export async function getAppLogs( client: LiaraClient, appName: string, options?: { limit?: number; since?: string; until?: string; } ): Promise<LogEntry[]> { validateAppName(appName); const params: any = {}; if (options?.limit) { params.limit = options.limit; } if (options?.since) { params.since = options.since; } if (options?.until) { params.until = options.until; } return await client.get<LogEntry[]>( `/v1/projects/${appName}/logs`, params ); }
- src/api/types.ts:347-352 (schema)Type definition for the input parameters of the logs tool, matching the options accepted by getAppLogs.export interface LogsRequest { since?: string; until?: string; limit?: number; follow?: boolean; }
- src/services/observability.ts:64-73 (helper)Supporting function for streaming logs, which currently delegates to getAppLogs for recent logs.export async function streamAppLogs( client: LiaraClient, appName: string ): Promise<LogEntry[]> { validateAppName(appName); // For now, return recent logs // WebSocket streaming would require separate implementation return await getAppLogs(client, appName, { limit: 100 }); }
- src/api/types.ts:340-345 (schema)Type definition for individual log entry returned by the logs tool.export interface LogEntry { timestamp: string; message: string; level?: 'info' | 'warn' | 'error' | 'debug'; source?: string; }