Comments (6)
I figured out how I managed to produce this NPE. I was using an environment variable for the graylog server param, like this
<graylog2ServerHost>${GRAYLOG_SERVER_IP}</graylog2ServerHost>
and it was not set, so the value GRAYLOG_SERVER_IP_IS_UNDEFINED comes in, which causes this exception
Caused by: java.lang.IllegalStateException: Unknown host: GRAYLOG_SERVER_IP_IS_UNDEFINED: unknown error. Make sure you have specified the 'graylog2ServerHost' property correctly in your logback.xml'
at at me.moocar.logbackgelf.InternetUtils.getInetAddress(InternetUtils.java:53)
at at me.moocar.logbackgelf.GelfAppender.initExecutor(GelfAppender.java:89)
Then subsequent appends throw NPE
from logback-gelf.
Perhaps a good middle ground here is to add a regex for graylog2ServerHost to ensure that it matches an IP. Then, if it doesn't, print a warning. PRs welcome :) otherwise I'll eventually get to it.
from logback-gelf.
I see. What if somebody wanted to use a dns name? As it happens my plan was to move my system to do that, so apps can keep logging if I cycle my graylog server and it gets a new ip address.
from logback-gelf.
yeah, good point. I guess this would he hard to protect against. Out of interest, what part of the stack is setting the value to "GRAYLOG_SERVER_IP_IS_UNDEFINED"? I've never seen that before.
from logback-gelf.
I think its logback.
from logback-gelf.
Closing as error message is better after merging #49
from logback-gelf.
Related Issues (20)
- Additional debug possibilities HOT 1
- Redis support HOT 4
- Chuncking issue HOT 5
- NPE when there is no callerData HOT 1
- mention that input in the graylog server should be gelf udp HOT 6
- mvn build fails with unresolved dependency com.stuartsierra:component HOT 2
- Feature Request: JMS or AMQP transport HOT 3
- Unexpected IO failure HOT 6
- no colons supported in property values HOT 4
- How to install for a Java newbie HOT 5
- Allow use logback-access with logback-gelf HOT 4
- Problem with TCP appender HOT 1
- Inconsistent field type conversion HOT 1
- Error initializing static fields HOT 12
- Release or put actual SNAPSHOT to Sonotype OSS Nexus HOT 1
- 0.2 jar in maven repo broken
- Wrong IP address with ${HOSTNAME} HOT 4
- Strange versioning of releases
- Question: no exception or message if graylog2 server unreachable
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 logback-gelf.