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

add warning log for extension #11634

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

123liuziming
Copy link
Contributor

related to #11616

@123liuziming 123liuziming requested a review from a team June 19, 2024 14:58
if (externalExtensionsLocation != null && !externalExtensionsLocation.isEmpty()) {
List<URL> externalExtensions = parseLocation(externalExtensionsLocation, javaagentFile);
if (externalExtensions.isEmpty()) {
extensionClassLoadWarningMessage =
Copy link
Contributor

Choose a reason for hiding this comment

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

when extensionClassLoadWarningMessage is generated here, can you simply log it right after?
i don't find it necessary to have another static method logWarningIfAny and call it in AgentStarterImpl.
unless it's too early because of loggingCustomizer.init(earlyConfig)?

Copy link
Member

Choose a reason for hiding this comment

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

see the comment above

  // this class is used early, and must not use logging in most of its methods
  // in case the extension config can not be found, we save the warning
  // message and log it later, when the logging subsystem is initialized

if (externalExtensionsLocation != null && !externalExtensionsLocation.isEmpty()) {
List<URL> externalExtensions = parseLocation(externalExtensionsLocation, javaagentFile);
if (externalExtensions.isEmpty()) {
extensionClassLoadWarningMessage =
Copy link
Member

Choose a reason for hiding this comment

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

see the comment above

  // this class is used early, and must not use logging in most of its methods
  // in case the extension config can not be found, we save the warning
  // message and log it later, when the logging subsystem is initialized

String externalExtensionsLocation = earlyConfig.getString(EXTENSIONS_CONFIG);
if (externalExtensionsLocation != null && !externalExtensionsLocation.isEmpty()) {
List<URL> externalExtensions = parseLocation(externalExtensionsLocation, javaagentFile);
if (externalExtensions.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

might be nice to log warning when there are multiple extensions, but one of them is invalid location?

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.

4 participants