diff --git a/core/pom.xml b/core/pom.xml index 5224495..bf59bda 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -5,7 +5,7 @@ pl.tkowalcz.tjahzi tjahzi-parent - 0.9.11-SNAPSHOT + 0.9.13-SNAPSHOT core @@ -36,7 +36,7 @@ pl.tkowalcz.tjahzi loki-protobuf - 0.9.11-SNAPSHOT + 0.9.13-SNAPSHOT test diff --git a/core/src/test/java/pl/tkowalcz/tjahzi/HeadersTest.java b/core/src/test/java/pl/tkowalcz/tjahzi/HeadersTest.java index dc5146b..0cf0f13 100644 --- a/core/src/test/java/pl/tkowalcz/tjahzi/HeadersTest.java +++ b/core/src/test/java/pl/tkowalcz/tjahzi/HeadersTest.java @@ -212,7 +212,7 @@ class HeadersTest { wireMockServer.verify( postRequestedFor(urlMatching("/loki/api/v1/push")) .withHeader("content-type", matching("application/x-protobuf")) - .withHeader("content-length", matching("50|51")) + .withHeader("content-length", matching("[4-5][0-9]")) .withHeader("host", matching("localhost")) )); } diff --git a/log4j2-appender-nodep/pom.xml b/log4j2-appender-nodep/pom.xml index 2c142f6..6b72ff0 100644 --- a/log4j2-appender-nodep/pom.xml +++ b/log4j2-appender-nodep/pom.xml @@ -5,7 +5,7 @@ pl.tkowalcz.tjahzi tjahzi-parent - 0.9.11-SNAPSHOT + 0.9.13-SNAPSHOT log4j2-appender-nodep 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.