diff --git a/log4j2-appender/README.md b/log4j2-appender/README.md index d91f847..1072c45 100644 --- a/log4j2-appender/README.md +++ b/log4j2-appender/README.md @@ -1,7 +1,7 @@ # Log4j2 Appender -On top of a `Core` component with rather simplistic API we intend to build several layers that make it truly useful. Log4j2 -appender seemed like a good first. +On top of a `Core` component with rather simplistic API we intend to build several layers that make it truly useful. +Log4j2 appender seemed like a good first. ## Quick start guide @@ -30,56 +30,57 @@ appender seemed like a good first. 1. Include minimal appender configuration: ```xml - - ${sys:loki.host} - ${sys:loki.port} + + ${sys:loki.host} + ${sys:loki.port} - - %X{tid} [%t] %d{MM-dd HH:mm:ss.SSS} %5p %c{1} - %m%n%exception{full} - + + %X{tid} [%t] %d{MM-dd HH:mm:ss.SSS} %5p %c{1} - %m%n%exception{full} + - + ``` 1. Reference the appender from inside one of your logger definitions: ```xml - - - + + + ``` ### Note on Loki HTTP endpoint and host/port configuration -Tjahzi sends `POST` requests to `/loki/api/v1/push` HTTP endpoint. Specifying e.g. `loki.mydomain.com3100` +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. - +- 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 + + + 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 -of configuration so that the appender can be found. +This example sets up a root logger with a Loki appender. Note that `pl.tkowalcz.tjahzi.log4j2` is added to `packages` +attribute of configuration so that the appender can be found. ```xml @@ -102,7 +103,7 @@ of configuration so that the appender can be found.