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

Logcat logs can't be disabled via configuration #381

Open
almozavr opened this issue Jan 16, 2025 · 5 comments
Open

Logcat logs can't be disabled via configuration #381

almozavr opened this issue Jan 16, 2025 · 5 comments

Comments

@almozavr
Copy link

Despite configuration

ElasticApmConfiguration.builder().setLibraryLoggingPolicy(LoggingPolicy.disabled())

Logcat shows the logs, e.g.:

LoggingSpanExporter      I  'ViewDestroyed' : 5bacf... 0db9... INTERNAL [tracer: io.opentelemetry.lifecycle:] ...
@LikeTheSalad
Copy link
Contributor

Thanks for letting us know, @almozavr

The log you've pointed out is sent by OTel Android, so that's why our agent's config doesn't affect it. However, I agree it isn't ideal, so I will mark this issue for the 1.0.0 refactor to ensure it doesn't happen there.

@almozavr
Copy link
Author

almozavr commented Jan 17, 2025

I wonder if there is some kind of flag or resource attr OTel accepts to turn it off meanwhile? 🤔 For now quite a destructive way to "shut it down" is proguard :(

-assumenosideeffects class java.util.logging.Logger
{
  public void log(...);
}

@LikeTheSalad
Copy link
Contributor

I see. I couldn't find a config in OTel to disable their logs, and they're also using JUL which I'd say isn't as flexible as other frameworks such as slf4j for example, so there doesn't seem to be too many options, unfortunately. Having said that, the one thing I did find was that calling LogManager.getLogManager().reset() could do the trick (it would disable all logs that are sent using JUL, if I understood correctly), I haven't tried it though.

@almozavr
Copy link
Author

Thanks for the research! As far as I understand they still work on the global debug config which is expected (I hope) to be used for the logging purpose as well open-telemetry/opentelemetry-android#668

@LikeTheSalad
Copy link
Contributor

Thanks for the research! As far as I understand they still work on the global debug config which is expected (I hope) to be used for the logging purpose as well open-telemetry/opentelemetry-android#668

It's a feature I'd like to have there too, so if it's still not there by the time I'm done with the Elastic agent 1.0.0 changes and other OTel Android priorities, I can work on it then.

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

2 participants