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

Allow users to set otel.javaagent.logging in config.properties file #8381

Conversation

0x006EA1E5
Copy link

Currently the otel.javaagent.logging property will only be read from env vars / system properties. This change will mean the option can be set in the config.properties file

  • Will attempt to read otel.javaagent.logging value from config.properties if not found in ConfigPropertiesUtil
  • Change access to EarlyInitAgentConfig via a new INSTANCE constant

* Will attempt to read `otel.javaagent.logging` value from config.properties if not found in `ConfigPropertiesUtil`
* Change access to `EarlyInitAgentConfig` via a new `INSTANCE` constant
@0x006EA1E5 0x006EA1E5 requested a review from a team April 27, 2023 13:51
return new EarlyInitAgentConfig(ConfigurationFileLoader.getConfigFileContents());
}
public static final EarlyInitAgentConfig INSTANCE =
new EarlyInitAgentConfig(ConfigurationFileLoader.getConfigFileContents());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually introduces a chicken-and-egg problem: ConfigurationFileLoader uses loggers, and these cannot be used before the logging system is initialized; which means you cannot use EarlyInitAgentConfig before LoggingCustomizer runs, the way the code is shaped right now.
@0x006EA1E5 I'll try to come up with a few ideas on how to refactor or circumvent that, will come back to this PR in a couple days.

@mateuszrzeszutek
Copy link
Member

Hey @0x006EA1E5 ,
I tried to figure out how to fix the logger problem in this PR, and I ended up reimplementing it in #8413. Can you take a look at it and see if it fits your use case?

@0x006EA1E5
Copy link
Author

Hey @0x006EA1E5 , I tried to figure out how to fix the logger problem in this PR, and I ended up reimplementing it in #8413. Can you take a look at it and see if it fits your use case?

looks good, thanks

@0x006EA1E5 0x006EA1E5 closed this May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make otel.javaagent.logging configurable from file
2 participants