Comments (6)
Hi Demetri,
this is an logback/network issue. Logback tries to resolve the local host name (forward/reverse) (see ch.qos.logback.core.util.ContextUtil/ContextUtil.java:35):
public static String getLocalHostName()
This runs in my case into an UnknownHostException which causes log back to fall back to the ip address. I've committed also some test cases into the repo to find out what's going on.
from logstash-gelf.
So, is the logback bug currently open or fixed? I see this: http://jira.qos.ch/browse/LOGBACK-749 Looks like you rev'd logback version dependency?
from logstash-gelf.
Yes, I've updated to 1.0.13. The logback bug is fixed. The bugfix causes logback not to crash any more but leads to supply the ip address (IPv4 or IPv6) when using HOSTNAME. You should get the right data a production environment where you have a DNS set up with correct setup hosts. (forward/reverse lookup entries).
from logstash-gelf.
Ahh, I understand your previous comment now, thanks. Is there an open issue against logback for this behavior? Seems to me requiring reverse DNS is not okay. We're behind a NAT here so all local workstations may show up as one "host". As I showed in my example, I can get the "correct" (preferred) hostname via the hostname command in logback.groovy. I double checked logback version on my end and it is also 1.0.13.
from logstash-gelf.
I was able to workaround my issue with the above additionalFields entry as well as adding to logstash the following:
filter {
if [type] == "gelf" {
mutate {
# Renames the 'originHost' field to 'host'
rename => [ "originHost", "host" ]
}
}
}
from logstash-gelf.
There is one more thing: logstash-gelf comes with an utility class RuntimeContainer, there you can find some constants which contain the hostname, FQDN and IP address. Check it out.
from logstash-gelf.
Related Issues (20)
- Application main thread got blocked with GelfLogbackAppender HOT 2
- Q: Removing "Facility" and "short_message" fields? HOT 2
- java.lang.NoSuchMethodError: biz.paluch.logging.gelf.log4j.GelfLogAppender.setAdditionalFieldTypes(Ljava/lang/String;) HOT 1
- Return lowercase to first letter of Log Fields HOT 1
- Configure max size on certain fields
- When will the next version be published on maven? HOT 1
- Changing MDC value type from numeric to alphanumeric stops working for gelf logging HOT 1
- Upgrade dependencies HOT 1
- Release 1.15.0
- Kafka Transport throws Class not found error HOT 3
- Printing Level name HOT 1
- JUL (Slf4j) + MDC HOT 1
- exceptionClass, exceptionMessage fields HOT 1
- Hi.There may be a Direct Byte Memory GC problem here HOT 6
- Delay UDP connect until first log event emission HOT 6
- OutOfMemoryError: Cannot reserve 327680 bytes of direct buffer memory HOT 1
- log4j 1.2.x Instructions on README Missing and Link Doesn't Go Anywhere HOT 1
- 在log4j2的配置文件中可以支持引用环境变量或者bootstrap.properties(ctx)中的变量吗 HOT 1
- Release 1.15.1
- Archive project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logstash-gelf.