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

Java agent causes Java logging (JUL) issues on various platforms #1127

Open
dhoard opened this issue Jan 31, 2025 · 0 comments
Open

Java agent causes Java logging (JUL) issues on various platforms #1127

dhoard opened this issue Jan 31, 2025 · 0 comments

Comments

@dhoard
Copy link
Collaborator

dhoard commented Jan 31, 2025

Issues

The JMX Exporter Java agent's use of standard Java logging (JUL). This causes various issues due to initialization/classloader issues because a Java agent uses a different classloader/classpath than an application.

Related Issues

JMX Exporter Java agent issues...

... and GlashFish issues...

Investigate using a native logging implementation

The JMX Exporter already has a native logging implementation that is used for development/developer debugging.

https://github.com/prometheus/jmx_exporter/tree/main/collector/src/main/java/io/prometheus/jmx/logger

Pros

Migrating all code using standard Java logging (JUL) to the native implementation will resolve these issues since the code is packaged in the Java agent.

This makes integration into applications that use a custom JUL LogManager/logging implementation a non-issue.

Cons

The native logging solution, which is currently only used for development/developer debugging, is very limited.

  • all or nothing
  • only logs to System.out
  • doesn't log to a file
  • doesn't have per class configuration
  • only a single logging level
  • is not dynamic

In most scenarios, JMX Exporter logging is typically only used when there are issues with the exporter. We may be able to solve some of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant