DOCUMENTATION

Understand the contract. Then write the event.

A compact reference for the LogAPI example envelope and the choices around it. Begin locally, validate what you emit, and choose your own delivery destination.

The example model

The examples use one small, versioned JSON envelope. Shared fields describe the event identity, time, service, severity, and name. The attributes object holds typed, event-specific context. This is a custom teaching format—not an OTLP payload, an ingestion endpoint, or a promise of compatibility with a storage provider.

The goal is to make every field interpretable. An HTTP request, a model attempt, and a permission decision can share an envelope without pretending they are the same operation.

A practical reading order

What these resources do—and do not—provide

The code examples write a single safe synthetic event to standard output. The downloadable schema validates the shared envelope and simple attribute types. The guides explain design questions for your application and collection pipeline.

Authentication, tenant isolation, transport encryption, storage, query access, and operational delivery guarantees require a separate production implementation. Do not point an application at an invented LogAPI.com ingestion URL. No such endpoint is defined here.

Version your own decisions

Keep the schema and representative fixtures alongside application changes. Add a new field instead of silently changing an existing field’s meaning. Test both old and new records when updating the collector or destination mapping. Record the version of any external convention you adopt.

Read the structured JSON logging guide for a fuller treatment of types, units, and migration behavior.