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 如何在SpringBoot2.0中配置NewRelic?_Spring Boot_Newrelic - Fatal编程技术网

Spring boot 如何在SpringBoot2.0中配置NewRelic?

Spring boot 如何在SpringBoot2.0中配置NewRelic?,spring-boot,newrelic,Spring Boot,Newrelic,我有一个关于用SpringBoot2.x配置NewRelic的基本问题 在此之前,我能够在build.gradle文件中包含以下内容: springBoot { mainClassName 'com.fake.Application' agent = file ('/build/libs/newrelic-agent.jar') } 但当我升级到spring boot gradle plugin 2.0.4.RELEASE(从1.5.15升级到2.0.4.RELEASE)时,我

我有一个关于用SpringBoot2.x配置NewRelic的基本问题

在此之前,我能够在build.gradle文件中包含以下内容:

springBoot {
    mainClassName 'com.fake.Application'
    agent = file ('/build/libs/newrelic-agent.jar')
}
但当我升级到spring boot gradle plugin 2.0.4.RELEASE(从1.5.15升级到2.0.4.RELEASE)时,我遇到了以下错误:

Could not set unknown property 'agent' for object of type org.springframework.boot.gradle.dsl.SpringBootExtension.

我看到“代理”不再是SpringBootExtension类中的属性。。。那么,配置NewRelic的最佳方式是什么

一位同事帮我解决了这个问题。事实上,我不需要通过SpringBootClass以这种方式运行NewRelic。由于我的应用程序部署在Docker容器中,因此我可以将其配置为在Dockerfile中运行,如下所示:

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-javaagent:/usr/local/newrelic/newrelic.jar","-jar","/app.jar"]