grafana / pyroscope-java

pyroscope java integration
Apache License 2.0
72 stars 31 forks source link

Use logging framework #126

Open zalintyre opened 8 months ago

zalintyre commented 8 months ago

pyroscope-java currently uses a custom logger implementation.

I'd like to propose the usage of a dedicated logging framework like SLF4J. What do you think?

korniltsev commented 5 months ago

pyroscope jar creates a shadow copy of all dependncies and has no logger dependency.

If it is loaded as javaagent - I dont see a good way to use logging frameworks? Do you?

If it is loaded as a java dependency from java code - you can pass a logger interface implementation passing calls to whatever logging framework is used in the app. Does it make sense and work for you?

devurandom commented 2 months ago

If it is loaded as javaagent - I dont see a good way to use logging frameworks? Do you?

The OpenTelemetry JavaAgent somehow manages to log to SLF4J, even though it is an agent. Maybe these code references are helpful to figure out how: