Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 使用logback.xml时,无法使用application.properties将Spring boot应用程序与Azure application insight链接_Spring Boot_Azure Application Insights - Fatal编程技术网

Spring boot 使用logback.xml时,无法使用application.properties将Spring boot应用程序与Azure application insight链接

Spring boot 使用logback.xml时,无法使用application.properties将Spring boot应用程序与Azure application insight链接,spring-boot,azure-application-insights,Spring Boot,Azure Application Insights,我已经创建了一个SpringBootStarter项目,并将Azure Application insight链接到该项目。像instrumentation-key这样的属性在“application.properties”中定义。启动应用程序时,它已正确链接到App Insight,可通过Live Metrics Stream进行验证 但是,如果项目(在参考资料中)中包含logback.xml,则同一应用程序无法连接到Azure App Insight,在这种情况下,要连接到App Insig

我已经创建了一个SpringBootStarter项目,并将Azure Application insight链接到该项目。像instrumentation-key这样的属性在“application.properties”中定义。启动应用程序时,它已正确链接到App Insight,可通过Live Metrics Stream进行验证

但是,如果项目(在参考资料中)中包含logback.xml,则同一应用程序无法连接到Azure App Insight,在这种情况下,要连接到App Insight,我还必须包含ApplicationInsights.xml。 但是我不想在我的应用程序中使用“ApplicationInsights.xml”,原因有二。1.我不想要多个配置文件。2.我无法注入密钥,也就是说,无法将可能作为vm参数或环境变量出现的密钥外部化

仅当logback.xml不存在时,在application.properties中定义InstrumentationKey和其他配置才有效


示例项目(asset register.zip)可以在筛选敏感数据时发布配置文件。没有这一点,我无法回答这个问题。我已经在下面的位置上传了一个示例项目。而且如果logback.xml包含在项目中(在参考资料中),也可以看到Spring应用程序无法连接到Azure App Insight,在这种情况下,要连接到App Insight,我还必须包括ApplicationInsights.xml。仅当logback.xml不存在时,在application.properties中定义InstrumentationKey和其他配置才有效。看起来问题并不是实际帖子中提到的“SpringSecurity”,很抱歉误解了。你应该更新你的帖子,删除关于SpringSecurity应该受到责备的错误断言。