# STARTHERE — mgf-logship

> **Sibling library in the Magogi Foundation federation.**
> See [README.md](README.md) for what this library does; see
> [mgf-common/FEDERATION.md](https://codeberg.org/magogi-admin/mgf-standard/src/branch/main/FEDERATION.md)
> for the federation contract.

`mgf-logship` is **centralized log shipping** for `mgf-common`
consumers — the Layer-B half of the unified-logging program: a
**fail-open logging handler** that batches the canonical `LogRecord`
JSON + statistics and POSTs them to a collector over a versioned,
language-neutral wire protocol, plus a **store-now stub collector**.
It builds on `mgf-common`'s logging (`mgf.common.observability`) and
never the other way around.

---

## For consumers (using this library)

1. **Pin** in your `pyproject.toml`:
   ```toml
   dependencies = ["mgf-logship>=X.Y,<X.(Y+1)"]
   ```
   See [CHANGELOG.md](CHANGELOG.md) for the current minor.
2. **Install:** `uv add mgf-logship` (or `pip install mgf-logship`).
3. **Read** [README.md](README.md) for the stable surface — the
   shipping handler, the wire protocol, and the stub collector.
4. **Bootstrap your app** with mgf-common first — see
   [mgf-common/STARTHERE.md](https://codeberg.org/magogi-admin/mgf-common/src/branch/main/STARTHERE.md).
5. **Attach the handler** to your logging configuration so canonical
   `LogRecord`s batch and ship to your collector — fail-open, so a
   collector outage degrades to local logging rather than an app error.
6. **Adopt the federation contract** — file your
   `MGF_STANDARDS_CONFORMANCE.md` per
   [DOC-15](https://codeberg.org/magogi-admin/mgf-standard/src/branch/main/docs/standards/DOCUMENTATION.md).
7. **Run** `mgf-common catch-up` periodically to verify federation
   drift; see [FEDERATION.md](FEDERATION.md).

---

## For contributors

See [CONTRIBUTING.md](CONTRIBUTING.md). Standards are inherited
from [mgf-common](https://codeberg.org/magogi-admin/mgf-standard/src/branch/main/docs/standards/).

---

## Quick links

| Resource | Where |
|---|---|
| Library purpose | [README.md](README.md) |
| Release notes | [CHANGELOG.md](CHANGELOG.md) |
| What we depend on / who depends on us | [DEPS.md](DEPS.md) |
| Feedback (PAPER-NN) | [FEEDBACK.md](FEEDBACK.md) |
| Federation contract | [FEDERATION.md](FEDERATION.md) |
| Cross-project standards | [mgf-standard/docs/standards/](https://codeberg.org/magogi-admin/mgf-standard/src/branch/main/docs/standards/) |
