mirror of
https://github.com/tiennm99/tjahzi.git
synced 2026-10-13 22:16:25 +00:00
Change way of accessing hostname (#126)
The `${sys:hostname}` variable is not always set. However, Log4J2 has a default variable called `hostName` that is always available. This change adapts the example configuration to use the default variable.
See also: https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticConfiguration ("Default Properties": "The default map is pre-populated with a value for "hostName" that is the current system's host name or IP address [...]")
This commit is contained in:
1 parent
893e2f906d
commit
a8d5b39dec
1 file changed
+1
-1
@@ -39,7 +39,7 @@ Log4j2 appender seemed like a good first.
|
||||
<Pattern>%X{tid} [%t] %d{MM-dd HH:mm:ss.SSS} %5p %c{1} - %m%n%exception{full}</Pattern>
|
||||
</PatternLayout>
|
||||
|
||||
<Label name="server" value="${sys:hostname}"/>
|
||||
<Label name="server" value="${hostName}"/>
|
||||
</Loki>
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user