Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for finer timestamp resolution #96

Closed
tkowalcz opened this issue Aug 26, 2022 · 0 comments · Fixed by #97
Closed

Support for finer timestamp resolution #96

tkowalcz opened this issue Aug 26, 2022 · 0 comments · Fixed by #97
Labels
core Relates to Core component log4j2-appender Relates to Log4j2 Appender component

Comments

@tkowalcz
Copy link
Owner

tkowalcz commented Aug 26, 2022

Currently Tjahzi timestamps all logs using milliseconds precision timer. It is provided by log4j via getTimeMillis method on LogEvent.

Log4j and Loki supports finer precision timestamps. On Log4j side these are available via getInstant method. We should use that instead of getTimeMillis.

Discussed in #95

Originally posted by thgau August 26, 2022
I use the Thahzi with log4j and I see that the loki timestamp always has 000000 in the micro/nanoseconds part.
log4j is able to give the timestamps with finer resolution. I can put these into the text part. But still it does not reach the loki timestamp.

@tkowalcz tkowalcz added log4j2-appender Relates to Log4j2 Appender component core Relates to Core component logback-appender Relates to Logback Appender component and removed logback-appender Relates to Logback Appender component labels Aug 26, 2022
tkowalcz added a commit that referenced this issue Aug 26, 2022
tkowalcz added a commit that referenced this issue Aug 26, 2022
tkowalcz added a commit that referenced this issue Aug 26, 2022
tkowalcz added a commit that referenced this issue Aug 26, 2022
* Re 96: Using fine precision event time provided by log4j for log line timestamps. Loki as well as our serializer support it.

* Re #96: Fixed tests.

* Re #96: Fixed tests.

* Re #96: Improved tests.
@tkowalcz tkowalcz linked a pull request Aug 30, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Relates to Core component log4j2-appender Relates to Log4j2 Appender component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant