From f3e855e5637468736f86834f5eb283f230251068 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:24:45 -0500 Subject: [PATCH 1/4] Update JSON logs documentation to include 'error' field Fixes #300 Update JSON logs documentation to include 'error' field and explain log keys * Remove the example JSON log structure. * Add a section explaining what each key stands for. * Include possible values for the 'L' key. * Mention that the 'error' field may appear in the log. * Elaborate on the timestamp and message descriptions. --- configuration/observability.mdx | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/configuration/observability.mdx b/configuration/observability.mdx index ddde3e5..4535b72 100644 --- a/configuration/observability.mdx +++ b/configuration/observability.mdx @@ -79,30 +79,11 @@ For production deployments, we recommend using the JSON format as it's easier to We've prepared an [example](https://github.com/flipt-io/flipt/tree/main/examples/audit/log) showing how to set up Flipt with Grafana Loki and Promtail to ingest and query logs. -### JSON - -```json -{ - "L": "INFO", - "T": "2024-01-20T21:59:49-05:00", - "M": "finished unary call with code OK", - "server": "grpc", - "grpc.start_time": "2024-01-20T21:59:49-05:00", - "system": "grpc", - "span.kind": "server", - "grpc.service": "flipt.evaluation.EvaluationService", - "grpc.method": "Boolean", - "peer.address": "127.0.0.1:52635", - "grpc.code": "OK", - "grpc.time_ms": 0.146 -} -``` - -### Console +### Log Key Descriptions -```text -2024-01-20T22:04:18-05:00 INFO finished unary call with code OK {"server": "grpc", "grpc.start_time": "2024-01-20T22:04:18-05:00", "system": "grpc", "span.kind": "server", "grpc.service": "flipt.evaluation.EvaluationService", "grpc.method": "Boolean", "peer.address": "127.0.0.1:53714", "grpc.code": "OK", "grpc.time_ms": 0.373} -``` +- `L`: Level (log level). Possible values include: debug, info, warn, error, fatal, panic. +- `T`: Timestamp. The timestamp is in ISO 8601 format, which is a widely used format for representing date and time. It includes the date, time, and time zone information. For example, "2024-01-20T21:59:49-05:00" represents the date and time in the Eastern Time Zone (UTC-5). +- `M`: Message. The message provides a description of the log event. It can include information about the operation being performed, any errors encountered, or other relevant details. More information about the available configuration options can be found in the [Logging configuration](/configuration/overview#logging) section. From 198f4fec9caab852bc76daa8de52888600cd11c3 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:27:41 -0500 Subject: [PATCH 2/4] chore: Update observability.mdx --- configuration/observability.mdx | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/configuration/observability.mdx b/configuration/observability.mdx index 4535b72..4768076 100644 --- a/configuration/observability.mdx +++ b/configuration/observability.mdx @@ -79,11 +79,30 @@ For production deployments, we recommend using the JSON format as it's easier to We've prepared an [example](https://github.com/flipt-io/flipt/tree/main/examples/audit/log) showing how to set up Flipt with Grafana Loki and Promtail to ingest and query logs. -### Log Key Descriptions +### JSON + +```json +{ + "L": "INFO", + "T": "2024-01-20T21:59:49-05:00", + "M": "finished unary call with code OK", + "server": "grpc", + "grpc.start_time": "2024-01-20T21:59:49-05:00", + "system": "grpc", + "span.kind": "server", + "grpc.service": "flipt.evaluation.EvaluationService", + "grpc.method": "Boolean", + "peer.address": "127.0.0.1:52635", + "grpc.code": "OK", + "grpc.time_ms": 0.146 +} +``` + +#### Log Key Descriptions -- `L`: Level (log level). Possible values include: debug, info, warn, error, fatal, panic. -- `T`: Timestamp. The timestamp is in ISO 8601 format, which is a widely used format for representing date and time. It includes the date, time, and time zone information. For example, "2024-01-20T21:59:49-05:00" represents the date and time in the Eastern Time Zone (UTC-5). -- `M`: Message. The message provides a description of the log event. It can include information about the operation being performed, any errors encountered, or other relevant details. +- `L`: Level (log level). Possible values include: debug, info, warn, error, fatal, and panic. +- `T`: Timestamp. The timestamp is in ISO 8601 format, widely used for representing date and time. It includes the date, time, and time zone information. For example, "2024-01-20T21:59:49-05:00" represents the date and time in the Eastern Time Zone (UTC-5). +- `M`: Message. The message describes the log event. It can include information about the operation, errors encountered, or other relevant details. More information about the available configuration options can be found in the [Logging configuration](/configuration/overview#logging) section. From 95be4b3cbae11fc7fa10e707243dcf6a5075d5ba Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:28:57 -0500 Subject: [PATCH 3/4] chore: Update observability.mdx --- configuration/observability.mdx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configuration/observability.mdx b/configuration/observability.mdx index 4768076..d799037 100644 --- a/configuration/observability.mdx +++ b/configuration/observability.mdx @@ -65,8 +65,8 @@ You can find the dashboards in our [grafana-dashboards](https://github.com/flipt Flipt writes logs to STDOUT in two formats: -- JSON -- Console +- [JSON](#json) +- [Console'(#console) The format can be configured via the `log.encoding` configuration option. @@ -104,6 +104,12 @@ We've prepared an [example](https://github.com/flipt-io/flipt/tree/main/examples - `T`: Timestamp. The timestamp is in ISO 8601 format, widely used for representing date and time. It includes the date, time, and time zone information. For example, "2024-01-20T21:59:49-05:00" represents the date and time in the Eastern Time Zone (UTC-5). - `M`: Message. The message describes the log event. It can include information about the operation, errors encountered, or other relevant details. +### Console + +```text +2024-01-20T22:04:18-05:00 INFO finished unary call with code OK {"server": "grpc", "grpc.start_time": "2024-01-20T22:04:18-05:00", "system": "grpc", "span.kind": "server", "grpc.service": "flipt.evaluation.EvaluationService", "grpc.method": "Boolean", "peer.address": "127.0.0.1:53714", "grpc.code": "OK", "grpc.time_ms": 0.373} +``` + More information about the available configuration options can be found in the [Logging configuration](/configuration/overview#logging) section. ## Tracing From faccd1b79073c904f3973629aa39154987ebd7bd Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:29:14 -0500 Subject: [PATCH 4/4] chore: Update observability.mdx --- configuration/observability.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/observability.mdx b/configuration/observability.mdx index d799037..c446451 100644 --- a/configuration/observability.mdx +++ b/configuration/observability.mdx @@ -66,7 +66,7 @@ You can find the dashboards in our [grafana-dashboards](https://github.com/flipt Flipt writes logs to STDOUT in two formats: - [JSON](#json) -- [Console'(#console) +- [Console](#console) The format can be configured via the `log.encoding` configuration option.