grafana / pyroscope-java

pyroscope java integration
Apache License 2.0
86 stars 32 forks source link

Use logging framework #126

Open zalintyre opened 1 year ago

zalintyre commented 1 year 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 10 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 7 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: