You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're using the *exec* form, add the parameter `-javaagent:"path/to/applicationinsights-agent-3.4.1.jar"` to the parameter list somewhere before the `"-jar"` parameter, for example:
24
+
If you're using the *exec* form, add the parameter `-javaagent:"path/to/applicationinsights-agent-3.4.2.jar"` to the parameter list somewhere before the `"-jar"` parameter, for example:
And invoke the `attach()` method of the `com.microsoft.applicationinsights.attach.ApplicationInsights` class
53
53
in the first line of your `main()` method.
54
54
55
+
> [!WARNING]
56
+
>
57
+
> The invocation must be at the beginning of the `main` method.
58
+
55
59
> [!WARNING]
56
60
>
57
61
> JRE is not supported.
58
62
59
63
> [!WARNING]
60
64
>
61
-
> Read-only file system is not supported.
62
-
63
-
> [!WARNING]
64
-
>
65
-
> The invocation must be at the beginning of the `main` method.
65
+
> The temporary directory of the operating system should be writable.
66
66
67
67
Example:
68
68
@@ -79,20 +79,23 @@ public class SpringBootApp {
79
79
80
80
### Configuration
81
81
82
-
> [!NOTE]
83
-
> Spring's `application.properties` or `application.yaml` files are not supported as
84
-
> as sources for Application Insights Java configuration.
85
-
86
82
Programmatic enablement supports all the same [configuration options](./java-standalone-config.md)
87
83
as the JVM argument enablement, with the following differences below.
88
84
89
85
#### Configuration file location
90
86
91
87
By default, when enabling Application Insights Java programmatically, the configuration file `applicationinsights.json`
92
-
will be read from the classpath.
88
+
will be read from the classpath (`src/main/resources`, `src/test/resources`).
89
+
90
+
From 3.4.2, you can configure the name of a JSON file in the classpath with the `applicationinsights.runtime-attach.configuration.classpath.file` system property.
91
+
For example, with `-Dapplicationinsights.runtime-attach.configuration.classpath.file=applicationinsights-dev.json`, Application Insights will use `applicationinsights-dev.json` file for configuration.
92
+
93
+
> [!NOTE]
94
+
> Spring's `application.properties` or `application.yaml` files are not supported as
95
+
> as sources for Application Insights Java configuration.
93
96
94
97
See [configuration file path configuration options](./java-standalone-config.md#configuration-file-path)
95
-
to change this location.
98
+
to change the location for a file outside the classpath.
0 commit comments