From 83c6b84799b0d96d1140250ed59f6e66f6e9d99d Mon Sep 17 00:00:00 2001 From: Daniel Mangum Date: Wed, 17 Dec 2025 11:10:33 -0500 Subject: [PATCH 1/4] pipelines: destinations: add golioth logs destination Adds the golioth logs destination to Pipelines docs. Signed-off-by: Daniel Mangum --- docs/data-routing/4-destinations/16-logs.md | 60 +++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 docs/data-routing/4-destinations/16-logs.md diff --git a/docs/data-routing/4-destinations/16-logs.md b/docs/data-routing/4-destinations/16-logs.md new file mode 100644 index 00000000..44e3d267 --- /dev/null +++ b/docs/data-routing/4-destinations/16-logs.md @@ -0,0 +1,60 @@ +--- +title: logs +--- + +| | | +|---|:---:| +|__Latest Version__| `v1.0.0` | +|__Input Content Type__| `application/json` | + +:::usage +Sending data to Golioth Logs incurs usage costs after exceeding the free tier. +See [Golioth pricing](https://golioth.io/pricing) for more information. +::: + +The Logs destination sends data to [Golioth Logs](/device-management/logging). +Data must have arrived as or been transformed into JSON in order to be delivered +successfully. + +The data message timestamp will be used as the time for the entry in Golioth +Logs, and the following JSON fields are supported. + +| Attribute | Description | +|-----------|------------------------------------------------------------------------| +| `level` | String indicating the log level (`debug`, `info`, `warn`, `error`). | +| `module` | String indicating the module from which the log message was generated. | +| `msg` | String with log message contents. | + +Any additional JSON fields will be stored as metadata with the entry in Golioth +Logs. + +### Example Usage + +Because Golioth Logs is hosted by Golioth, no configuration or credentials are +required to deliver data to the service. + +```yaml + destination: + type: logs + version: v1 +``` + +### Example Input + +```json +{ + "level": "warn", + "module": "net_sockets", + "msg": "failed to send" +} +``` + +### Example Output + +```json +{ + "level": "warn", + "module": "net_sockets", + "msg": "failed to send" +} +``` From 574ca337b2c4da99274c04433f9ee4bdb4c93f48 Mon Sep 17 00:00:00 2001 From: Daniel Mangum Date: Wed, 17 Dec 2025 11:10:57 -0500 Subject: [PATCH 2/4] pipelines: examples: add golioth logs CBOR example Adds a simple example for routing CBOR log messages to the Golioth Logs service. Signed-off-by: Daniel Mangum --- docs/data-routing/5-examples/28-golioth-logs-cbor.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/data-routing/5-examples/28-golioth-logs-cbor.md diff --git a/docs/data-routing/5-examples/28-golioth-logs-cbor.md b/docs/data-routing/5-examples/28-golioth-logs-cbor.md new file mode 100644 index 00000000..4e5fa4b9 --- /dev/null +++ b/docs/data-routing/5-examples/28-golioth-logs-cbor.md @@ -0,0 +1,9 @@ +--- +title: Golioth Logs CBOR +--- +import Pipeline from '@site/src/components/usethispipeline' + +This simple example matches on any CBOR data message, transforms the payload to +JSON, then delivers it to [Golioth Logs](/device-management/logging). + + From 86b9a8d266bbd91b3e8a573b8ffaf82f6c9370b9 Mon Sep 17 00:00:00 2001 From: Daniel Mangum Date: Wed, 17 Dec 2025 11:11:52 -0500 Subject: [PATCH 3/4] logs: redirect to pipelines data destination Removes the device API docs for logs and instead redirects to the logs Pipeline destination, which is the preferred mechanism to interact with logs today. Signed-off-by: Daniel Mangum --- .../2-device-api/3-api-docs/5-logging.md | 26 ------------------- firebase.json | 10 +++++++ 2 files changed, 10 insertions(+), 26 deletions(-) delete mode 100644 docs/reference/2-device-api/3-api-docs/5-logging.md diff --git a/docs/reference/2-device-api/3-api-docs/5-logging.md b/docs/reference/2-device-api/3-api-docs/5-logging.md deleted file mode 100644 index 01a2470d..00000000 --- a/docs/reference/2-device-api/3-api-docs/5-logging.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: logging -title: Logging ---- - -[Logging Device Service](/device-management/logging) definitions over CoAP. - -How to use guides: - -- [Sending logs](/device-management/logging/sending-logs) - -### Interface - -| Method | Description | Path | Content Format | -| -------- | ----------- | ----- | -------------- | -| POST/PUT | Send logs | /logs | JSON/CBOR | - -### Parameters and attributes that are known and indexed: - -| Attribute | Description | Default | -| --------------------- | ----------------------------------------------------------------------------------- | ------- | -| `time` or `timestamp` | Timestamp of the log entry | now() | -| level | Log Level - Can be info/warn/error/debug | info | -| module | Internal module that is generating logs | | -| `msg` or `message` | Free form string with the log message | | -| | Any other attribute sent over this endpoint is bundled into a `metadata` attribute. | | diff --git a/firebase.json b/firebase.json index f25748ec..781072f4 100644 --- a/firebase.json +++ b/firebase.json @@ -229,6 +229,11 @@ "source": "/device-management/authentication{,/**}", "destination": "/connectivity/credentials", "type": 301 + }, + { + "source": "/reference/device-api/api-docs/logging", + "destination": "/data-routing/destinations/logs", + "type": 301 } ], "rewrites": [ @@ -492,6 +497,11 @@ "source": "/device-management/authentication{,/**}", "destination": "/connectivity/credentials", "type": 301 + }, + { + "source": "/reference/device-api/api-docs/logging", + "destination": "/data-routing/destinations/logs", + "type": 301 } ], "rewrites": [ From 2b4e446e31dd552056e08395c412e8a90c8fd950 Mon Sep 17 00:00:00 2001 From: Daniel Mangum Date: Wed, 17 Dec 2025 11:12:52 -0500 Subject: [PATCH 4/4] device-management: logs: update sending logs docs Updates docs for sending log messages to point to Pipelines. Signed-off-by: Daniel Mangum --- .../4-logging/3-sending-logs.md | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/docs/device-management/4-logging/3-sending-logs.md b/docs/device-management/4-logging/3-sending-logs.md index 9da29515..6012064b 100644 --- a/docs/device-management/4-logging/3-sending-logs.md +++ b/docs/device-management/4-logging/3-sending-logs.md @@ -3,25 +3,11 @@ id: sending-logs title: Sending Logs --- -import Prerequisites from '/docs/_partials-common/prerequisites-platform-setup.md' -import { ProtocolPublishSample } from '/docs/_partials-common/protocol.mdx' - - - -Our platform provides functionality for tracking your devices logs, so you can have a better sense of things that are happening out in the field. - -An endpoint is provided on our gateways on the `/logs` path where the device can send log data. Right now only the CoAP gateway is available to use this service. - -Data can be sent using query parameters and also on the message body. The message body can be send in CBOR or JSON format and is going to be parsed and we will try to identify the known attributes as presented below. If the body is sent as plain text, it will be saved as the log entry message. - -> See the [Device API documentation](/reference/device-api/api-docs/logging) - -### Simulating device logs using `coap` - -You can simulate sending logs by using `coap` and POSTing data to the `/logs` endpoint. - -In the example bellow, we are sending the parameters `module`, `level` and `network` as query parameters and also a message in JSON format in the body containing the log `msg`. - - - -After sending a log entry you can search logs using `goliothctl`. Check the [next page](./searching-logs) for more details on how to do that. +Log messages are delivered to the Golioth Logs service via +[Pipelines](/data-routing). By default, any new Projects created on the Golioth +platform will have a [CBOR logs +Pipeline](/data-routing/examples/golioth-logs-cbor) configured automatically +that will deliver data to Golioth Logs. + +See the [Golioth Logs data destination](/data-routing/destinations/logs) for +more information.