如何禁用Google Cloud Platform集成?

路加福音101

我的POM文件中有以下两个依赖项:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-gcp-starter-trace</artifactId>
</dependency>
<dependency>
     <groupId>org.springframework.cloud</groupId>
     <artifactId>spring-cloud-gcp-starter-logging</artifactId>
</dependency>

我想在某些配置文件中禁用这些GCP功能。我需要在本地测试我的应用程序,但GCP一直妨碍您。

米歇尔

设置应用程序时,Spring取决于自动配置。在许多情况下,它会扫描类路径中的某些依赖项,如果存在某些依赖项,则会执行自动配置。在大多数情况下,可以通过提供特定条件来绕过自动配置。

在遍历Spring Cloud gcp模块时,我遇到了StackdriverLoggingAutoConfigurationsource)和StackdriverTraceAutoConfigurationsource)类。

StackdriverLoggingAutoConfiguration具有条件ConditionalOnProperty(value="spring.cloud.gcp.logging.enabled", matchIfMissing=true),而StackdriverTraceAutoConfiguration具有条件@ConditionalOnProperty(value="spring.cloud.gcp.trace.enabled", matchIfMissing=true)

我不确定这些属性是否与您使用的模块的自动配置有关,但是您可以通过将以下内容添加到应用程序{localprofile} .properties中来禁用日志记录:

spring.cloud.gcp.logging.enabled=false
spring.cloud.gcp.trace.enabled=false

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

将Google Colab与Google Cloud Platform集成以获得更多RAM?

Google Cloud Platform:如何重命名Google Cloud Platform项目?

Google Cloud Messaging VS Google Cloud Platform

如何删除我的Google Cloud Platform帐户?

Google Cloud Platform文件位置

Google Cloud Platform个人帐单

Google Cloud Platform数据显示

Google Cloud Platform修复SSH

如何将 Google Cloud Text-to-Speech 与 Meteor 集成

如何将 grafana 与 Google Cloud SQL 集成

Google Cloud Platform和Google Cloud Firestore之间的区别?

Google Cloud Platform上的Polymer Starter Kit-如何

如何增加Google Cloud Platform中的后端服务配额?

如何使用python从google-cloud-platform下载数据?

如何删除我的Google Cloud Platform结算帐户?

如何将Google Cloud Platform用作私人客户?

如何从Google Cloud Platform存储下载文件

如何在Google Cloud Platform上加快bazel构建

如何在Google Cloud Platform上安装Godaddy SSL证书

缺少链接时如何访问Google Apps脚本的Cloud Platform

Google Cloud Platform AI Notebook - 如何确保使用 GPU?

如何使用Go SDK for Google Cloud Platform获取项目ID?

如何從 Google Cloud Platform 下載表格

如何按小时监控 Google Cloud Platform (GCP) 成本?

如何在Google Cloud Platform中获取服务的DNS名称?

如何清除Google Cloud Platform中的Stackdriver日志?

如何在Google Cloud Platform中配置特定的数据管道?

如何在 Google Cloud Platform 中安装 cmake

使用Google Cloud Platform时如何锁定状态文件?