diff --git a/content/components/_index.md b/content/components/_index.md index 0570e30e7e..dd46350eeb 100644 --- a/content/components/_index.md +++ b/content/components/_index.md @@ -132,6 +132,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" diff --git a/content/components/loki.md b/content/components/loki.md new file mode 100644 index 0000000000..5b56bd4e64 --- /dev/null +++ b/content/components/loki.md @@ -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`. diff --git a/static/images/loki.svg b/static/images/loki.svg new file mode 100644 index 0000000000..2daa843c2a --- /dev/null +++ b/static/images/loki.svg @@ -0,0 +1 @@ + \ No newline at end of file