-
Notifications
You must be signed in to change notification settings - Fork 195
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
Appinsights logging for different environments #2576
Comments
we don't support applicationinsights-local.json nor applicationinsights-dev.json. |
I could see supporting custom classpath location for |
btw @andesk10
you shouldn't add an implementation dependency on the agent, the runtime-attach artifact bundles it internally (not as a transitive dependency) |
This would not work when the applicationinsight.json file (applicationinsight-local.json, applicationinsight-dev.json, ...) is included into a Spring Boot jar file. So, I would suggest providing a system property overriding the default name of the applicationinsight.json when the json file is retrieved from the classpath. This solution would fit well with Spring Boot profile configuration via system property ( |
Azure app insights is working in the way shown below.
Added these two dependencies:
Invoked the attach() method as mentioned in docs
@SpringBootApplication
public class SpringBootApp {
public static void main(String[] args) {
ApplicationInsights.attach();
SpringApplication.run(SpringBootApp.class, args);
}
}
I have created applicationinsight.json, added my connection string and placed in src/main/resources.
However, my need is to log local and dev logs to one connection string (resource group) and prod logs to another connection string (resource group).
I have tried creating a new file applicationinsight-local.json, applicationinsight-dev.json in same path. But, that doesnt seem to work.
Dont you offer this functionality.
Thanks.
The text was updated successfully, but these errors were encountered: