Giter Site home page Giter Site logo

Comments (8)

rfoltyns avatar rfoltyns commented on June 5, 2024 1

Done.

from log4j2-elasticsearch.

rfoltyns avatar rfoltyns commented on June 5, 2024 1

If you specify the time zone, index names will always be fine, cause the name is formatted by time-zoned FastDateFormat, there's no risk that logs will land in the wrong index.

However, due to the limitations of Log4j2 PatternProcessor (time zone can't be specified, TimeZone.getDefault() is always used), currentTime and nextRolloverTime will not be set properly when using time zone other that default and RollingIndexNameFormatter may fallback to non-cached indexName path and generate a bit more garbage than it should.

As for the logevent timestamps - querying might be affected, especially if you search from <date_in_the_past> until now() - in some scenarios, if Kibana is not configured properly, some events may not be found. There are lots of issues and discussions about it and I haven't found a suitable solution for that.

Bottom line is: whatever zone you use - machine default, UTC or any other - make sure that you can still get proper results and/or adjust your queries accordingly :) In the end, it was a nicely spotted bug and hopefully usage of TimeZone.getDefault() will bring more good results than damage :)

from log4j2-elasticsearch.

rfoltyns avatar rfoltyns commented on June 5, 2024

Time zones are tricky.. ES assumes that timestamps come in UTC by default, so it will have implications one way or the other.
Nevertheless, I've changed the default to machine time. Let's test it out.

from log4j2-elasticsearch.

rfoltyns avatar rfoltyns commented on June 5, 2024

I ran into some issues. I have to revert it and do some more testing on that. Can you stick to explicitly specified timezone for a while?

from log4j2-elasticsearch.

thaarbach avatar thaarbach commented on June 5, 2024

@rfoltyns

ES assumes that timestamps come in UTC by default, so it will have implications one way or the other.

Thats true, but how impact the time zone for generating the index name the logevent time stamp?

from log4j2-elasticsearch.

thaarbach avatar thaarbach commented on June 5, 2024

Ah, that's make it clear. Thank you for your explanation.

I've checked if the RollingIndexNameFormatter without set a zone explictly. Now, it works as expected 👍

from log4j2-elasticsearch.

rfoltyns avatar rfoltyns commented on June 5, 2024

Fantastic news. Thanks :)
I'll release it this weekend.

from log4j2-elasticsearch.

thaarbach avatar thaarbach commented on June 5, 2024

@rfoltyns
Cool, so i close this issue.

from log4j2-elasticsearch.

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.