diff --git a/log4j2-appender/README.md b/log4j2-appender/README.md index 1072c45..4f8972e 100644 --- a/log4j2-appender/README.md +++ b/log4j2-appender/README.md @@ -30,6 +30,7 @@ Log4j2 appender seemed like a good first. 1. Include minimal appender configuration: ```xml + ${sys:loki.host} ${sys:loki.port} @@ -45,6 +46,7 @@ Log4j2 appender seemed like a good first. 1. Reference the appender from inside one of your logger definitions: ```xml + @@ -59,6 +61,7 @@ will configure the appender to call to URL: `http://loki.mydomain.com:3100/loki/ ### 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. @@ -66,6 +69,7 @@ Password is your "Grafana.com API Key" and can be generated in "Grafana datasour is just for illustrative purposes. ```xml + logs-prod-us-central1.grafana.net @@ -115,12 +119,27 @@ attribute of configuration so that the appender can be found. Contents of the properties are [automatically interpolated by Log4j2](https://logging.apache.org/log4j/log4j-2.2/manual/configuration.html#PropertySubstitution) . All environment, system etc. variable references will be replaced by their values during initialization of the -appender. The exception is context/MDC (`${ctx:foo}`) value lookup as it make sense only during runtime. +appender. The exception to this rule is context/MDC (`${ctx:foo}`) value lookup - it is performed for each message at +runtime (allocation free). NOTE: This process could have been executed for every lookup type at runtime (for each log message). This approach was deemed too expensive. If you need a mechanism to replace a variable (other than context/MDC) after logging system initialization I would love to hear your use case - please file an issue. +## Patterns in Labels + +Alternative way of specifying label contents is via pattern attribute: + +```xml + +