Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/components/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ ESPHome-specific components or components supporting ESPHome device provisioning
"Debug","components/debug","bug-report.svg","dark-invert"
"Logger","components/logger","file-document-box.svg","dark-invert"
"Syslog","components/syslog","file-document-box.svg","dark-invert"
"Loki","components/loki","loki.svg",""
"Prometheus","components/prometheus","prometheus.svg",""
"StatsD","components/statsd","connection.svg","dark-invert"
"Safe Mode","components/safe_mode","restart-alert.svg","dark-invert"
Expand Down
39 changes: 39 additions & 0 deletions content/components/loki.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
description: "Instructions for setting up a loki component in ESPHome"
title: "Loki Component"
params:
seo:
description: Instructions for setting up a loki component in ESPHome
---

The `loki` component can be used to send ESPHome logs to a [loki server](https://grafana.com/oss/loki/).
It requires both a {{< docref "http_request" "HTTP Request" >}} and a {{< docref "time/index" "Time component" >}} to be configured.

```yaml
# Example configuration entry

http_request:
useragent: esphome/loki
timeout: 10s
verify_ssl: false

time:
- platform: sntp
id: sntp_time

loki:
url: http://foo.com
level: DEBUG
enabled: true
```

## Configuration Options

- **id** (*Optional*, [ID](#config-id)): Manually specify the ID used for code generation.
- **http_request_id** (**Required**, [ID](#config-id)): The ID of the http_request client to use for sending logs. May be omitted if only
one http_request client is configured.
- **time_id** (**Required**, [ID](#config-id)): The ID of the time client to use for time-stamping logs. May be omitted
if only one time client is configured.
- **port** (*Optional*, int): The port of the `loki` instance to send logs to. Defaults to `3100`.
- **level** (*Optional*, string): The highest log level to send to the loki server. Defaults to `DEBUG`.
- **strip** (*Optional*, boolean): If set, remove color-codes from log messages. Defaults to `true`.
1 change: 1 addition & 0 deletions static/images/loki.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.