Comments (8)
Done.
from log4j2-elasticsearch.
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.
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.
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.
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.
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.
Fantastic news. Thanks :)
I'll release it this weekend.
from log4j2-elasticsearch.
@rfoltyns
Cool, so i close this issue.
from log4j2-elasticsearch.
Related Issues (20)
- Supporting ecs-logging-java HOT 8
- Package naming conventions HOT 11
- How to pass the value from ThreadContext to ValueProperty? HOT 3
- Can not log to elastic using log4j2 <PatternLayout> HOT 11
- Support elasticsearch data_streams HOT 6
- Failed to Load StackTraceElementMixIn HOT 22
- InvalidTypeNameException on invalid mappingType in ES 5 HOT 8
- Adding custom properties, that change during processing HOT 4
- Log4j2 Zero-Day vulnerability (CVE-2021-44228) HOT 2
- Support OpenSearch 2.x and Elasticsearch 8.x HOT 9
- Unable to determine if index already exists HOT 1
- Support for ECSLayout for elasticsearch-ahc and / or elaticsearch-jest in combination with data streams HOT 10
- Is it possible to deseriailze JSON within the message into properties? HOT 2
- Run elastic search appender in specific environment HOT 2
- Logging-Cleaner ERROR Could not create plugin HOT 3
- How do I add mdc attributes? HOT 1
- Could not initialize ChronicleMapRetryFailoverPolicy HOT 2
- ServiceDiscovery ERROR HCServiceDiscovery: Unable to refresh addresses: Cannot invoke "org.appenders.log4j2.elasticsearch.hc.discovery.NodeInfo$PublishAddress.getPublishAddress()" HOT 1
- Using log4j2-elasticsearch-hc -> Does AsyncLogger still not support adding dynamic keyValue pairs in Jackson JSONLayout HOT 5
- IS JacksonModule is implemented in latest version? HOT 7
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 log4j2-elasticsearch.