Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Add support for GraalVM Native Image using java.util.logging #213

Closed
loicmathieu opened this issue Nov 28, 2019 · 3 comments
Closed

Add support for GraalVM Native Image using java.util.logging #213

loicmathieu opened this issue Nov 28, 2019 · 3 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@loicmathieu
Copy link
Contributor

logstash-gelf version: 1.13.0

When using the library with an application build as a native image via GraalVM, it didn't works. No stacktraces are shown but no logs are issued.

To reproduce the issue, use the library inside a GraalVM native image and you will see that no log events are sent.

I chased down the issue to JulLogEvent.getThreadName(LogRecord). This method uses the ThreadMXBean to get the name of the thread from it's ID, but SubstratVM (the VM that runs the native image compiled by GraalVM) didn't implements JMX so this could not work.

I have a working solution that I can contribute via a PR to replace the usage of the ThreadMXBean by Thread.getAllStackTraces().keySet() however I don't know if it has some performance implication (as it uses a cache maybe not important).

@mp911de
Copy link
Owner

mp911de commented Nov 28, 2019

Happy to include changes that make logstash-gelf work in GraalVM native image runtimes.

This project is in maintenance mode meaning that we fix bugs and keep dependencies up to date but there's no one that could drive major improvements unless we get contributions in the form of pull requests.

@mp911de mp911de added the type: enhancement A general enhancement label Nov 28, 2019
@mp911de mp911de changed the title GraalVM Native image issue with JulLogEvent.getThreadName(LogRecord) Add support for GraalVM Native Image using java.util.logging Nov 28, 2019
@loicmathieu
Copy link
Contributor Author

OK I'll prepare a PR soone

@mp911de mp911de added this to the 1.14.0 milestone Dec 3, 2019
mp911de pushed a commit that referenced this issue Dec 3, 2019
mp911de added a commit that referenced this issue Dec 3, 2019
Add author tags. Move currentThread lookup to caching section.

Original pull request: #214.
@mp911de
Copy link
Owner

mp911de commented Dec 3, 2019

Fixed via #214.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants