Logtrail API Skill
This skill provides the necessary knowledge and patterns to integrate Logtrail's high-performance logging into any application.
Core Workflows
1. Ingesting Logs
To send logs to Logtrail, use the /logs endpoint.
- Header:
X-API-Key - Payload: JSON matching the
CreateLogRequestschema inreferences/openapi.yaml.
Example cURL:
curl -X POST https://api.logtrail.net/api/v1/workspace/logs \
-H "X-API-Key: $LOGTRAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "test", "level": "info", "clientTimestamp": "2026-02-14T00:00:00Z"}'
2. Querying logs with LCQL
Use the Logtrail Custom Query Language (LCQL) for advanced searches.
- Endpoint:
POST /logs/query - Body:
{ "query": "..." }
LCQL Syntax:
level=error(Facet)actor.id=123(Nested JSONB)action~"login*"(Partial match)message@"timeout"(Full-text)
References
- openapi.yaml: Full API specification including all schemas and error codes.
Implementation Patterns
When adding Logtrail to a project:
- Identify the logging framework (e.g., Zap, Pino).
- Configure the Logtrail HTTP transport or use an official SDK.
- Use the
testenvironment for development andlivefor production via scoped API keys.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.