Giter VIP home page Giter VIP logo

Comments (6)

mike-hogan avatar mike-hogan commented on September 2, 2024

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.

Moocar avatar Moocar commented on September 2, 2024

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.

mike-hogan avatar mike-hogan commented on September 2, 2024

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.

Moocar avatar Moocar commented on September 2, 2024

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.

mike-hogan avatar mike-hogan commented on September 2, 2024

I think its logback.

from logback-gelf.

Moocar avatar Moocar commented on September 2, 2024

Closing as error message is better after merging #49

from logback-gelf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.