'Spring Boot with Cloud GCP Firestore, got error with Google Compute Engine GCP Credential, How to disable the error logs

In our springboot project, we use only firestore, no other GCP services included

<dependency>
   <groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-gcp-starter-data-firestore</artifactId>
   <version>1.2.7.RELEASE</version>
</dependency>

but we always got error with GCP Credidential, I want to disable that track, how to do it?

java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

In the application property we put as:

spring
   cloud:
      gcp:
        firestore:
            enabled: true
            project-id: my-firestore-project-id
            credentials:
                location: classpath:my-firestore-authentication-file-xxxx.json

I already tried to disabled as:

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

and still error, the error wont stop the application but it's disturb and how to disable that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source