Skip to content

Commit

Permalink
Update JSON logs documentation to include 'error' field
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
markphelps committed Jan 20, 2025
1 parent 7d4aae5 commit f3e855e
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions configuration/observability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Check warning on line 85 in configuration/observability.mdx

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [Openly.So] Don't start a sentence with 'SO ' Raw Output: {"message": "[Openly.So] Don't start a sentence with 'SO '", "location": {"path": "configuration/observability.mdx", "range": {"start": {"line": 85, "column": 40}}}, "severity": "WARNING"}
- `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.

Expand Down

0 comments on commit f3e855e

Please sign in to comment.