Skip to content

Appinsights logging for different environments #2576

@andesk10

Description

@andesk10

Azure app insights is working in the way shown below.

Added these two dependencies:

  1. implementation("com.microsoft.azure:applicationinsights-agent:3.4.1")
  2. implementation("com.microsoft.azure:applicationinsights-runtime-attach:3.4.1")

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions