-
Notifications
You must be signed in to change notification settings - Fork 201
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
Support finding applicationinsights.json in current dir when using runtime attach #3990
base: main
Are you sure you want to change the base?
Conversation
Spring Boot can also retrieve configuration files in the The Application Insights json file could also be retrieved from this subdirectory. |
try { | ||
return Files.newInputStream(defaultFile.toPath()); | ||
} catch (IOException e) { | ||
throw new IllegalStateException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -52,7 +55,10 @@ public static void attach() { | |||
System.setProperty(RUNTIME_ATTACHED_ENABLED_PROPERTY, "true"); | |||
|
|||
try { | |||
Optional<String> jsonConfig = findJsonConfig(); | |||
Optional<String> jsonConfig = findJsonConfigFromClasspath(); | |||
if (!jsonConfig.isPresent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's assume the user adds a JSON configuration file in src/main/resources
and creates a Spring Boot executable JAR.
The user may want to use a configuration different from the default one in the classpath without creating a new JAR file.
It may be useful to check the configuration from the file system first.
Resolves #3989