File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
agent/runtime-attach/src/main/java/com/microsoft/applicationinsights/attach Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public static void attach() {
5656 try {
5757 Optional <String > jsonConfig = findJsonConfigFromClasspath ();
5858 if (!jsonConfig .isPresent ()) {
59- jsonConfig = findJsonConfigFromDefaultFileInCurrentDir ();
59+ jsonConfig = findJsonConfigFromFileSystem ();
6060 }
6161 if (jsonConfig .isPresent ()) {
6262 System .setProperty (RUNTIME_ATTACHED_JSON_PROPERTY , jsonConfig .get ());
@@ -85,7 +85,7 @@ private static Optional<String> findJsonConfigFromClasspath() {
8585 return Optional .of (json );
8686 }
8787
88- private static Optional <String > findJsonConfigFromDefaultFileInCurrentDir () {
88+ private static Optional <String > findJsonConfigFromFileSystem () {
8989
9090 InputStream configContentAsInputStream = findDefaultFileInCurrentDirAsStream ();
9191
@@ -118,7 +118,10 @@ private static InputStream findResourceAsStream(String fileName) {
118118 }
119119
120120 private static InputStream findDefaultFileInCurrentDirAsStream () {
121- File defaultFile = new File ("applicationinsights.json" );
121+ File defaultFile = new File ("config/applicationinsights.json" );
122+ if (!defaultFile .exists ()) {
123+ defaultFile = new File ("applicationinsights.json" );
124+ }
122125 if (!defaultFile .exists ()) {
123126 return null ;
124127 }
You can’t perform that action at this time.
0 commit comments