From c4275e4a1da4a3ddeeeadd2b16f61f8296958e84 Mon Sep 17 00:00:00 2001 From: "tomasz.kowalczewski" Date: Tue, 20 Apr 2021 00:34:29 +0200 Subject: [PATCH] Re #45: Added documentation about configuring Tjahzi for Grafana Cloud --- log4j2-appender/README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/log4j2-appender/README.md b/log4j2-appender/README.md index c815aa2..a01dfd0 100644 --- a/log4j2-appender/README.md +++ b/log4j2-appender/README.md @@ -55,6 +55,27 @@ appender seemed like a good first. Tjahzi sends `POST` requests to `/loki/api/v1/push` HTTP endpoint. Specifying e.g. `loki.mydomain.com3100` will configure the appender to call to URL: `http://loki.mydomain.com:3100/loki/api/v1/push`. +### Grafana Cloud configuration + +Tjahzi can send logs to Grafana Cloud. It needs two things to be configured: +- Set port number to `443` which switches HTTP client into HTTPS mode. +- Specify `username` and `password` for HTTP basic authentication that Grafana uses. + +Password is your "Grafana.com API Key" and can be generated in "Grafana datasource settings". The host in below example +is just for illustrative purposes. + +```xml + + + logs-prod-us-central1.grafana.net + 443 + + ... + ... + ... + +``` + ## Advanced configuration This example sets up a root logger with a Loki appender. Note that `pl.tkowalcz.tjahzi.log4j2` is added to `packages` attribute @@ -106,7 +127,16 @@ by call to `InetSocketAddress.createUnresolved`. #### Port (required) -Self-explanatory. +Port used for connecting to running Loki. Tjahzi by default uses plain HTTP but if the port is `443` then it will +automatically switch to HTTPS. + +#### Username + +Username for HTTP basic auth. + +#### Password + +Password for HTTP basic auth. #### Header (optional)