title: GCP logging with json appender for sping boot app
body: <p>I am trying adding gcp trace and logging to spring boot app but I get this error</p>
  <hr />
  <p>APPLICATION FAILED TO START</p>
  <hr />
  <p>Description:
  Parameter 1 of constructor in com.google.cloud.spring.logging.LoggingWebMvcConfigurer required a bean of type  com.google.cloud.spring.core.GcpProjectIdProvider that could not be found.
  Action:
  Consider defining a bean of type com.google.cloud.spring.core.GcpProjectIdProvider in your configuration.</p>
  <p>in gradle.build, I added the dependencies</p>
  <pre><code>implementation 'org.springframework.cloud:spring-cloud-gcp-autoconfigure:1.1.0.RELEASE'
  implementation 'com.google.cloud:spring-cloud-gcp-starter-logging:2.0.0'
  implementation 'org.springframework.cloud:spring-cloud-gcp-starter-trace:1.2.5.RELEASE'
  </code></pre>
  <p>and in application.properties</p>
  <pre><code>spring.main.allow-bean-definition-overriding=true
  spring.cloud.gcp.logging.enabled=true
  spring.sleuth.sampler.probability=1.0
  </code></pre>
  <p>in logback-spring.xml I have this configurations</p>
  <pre><code>&lt;configuration&gt;
      &lt;include resource=&quot;org/springframework/boot/logging/logback/defaults.xml&quot; /&gt;
      &lt;include resource=&quot;org/springframework/boot/logging/logback/console-appender.xml&quot; /&gt;
  
      &lt;springProfile name=&quot;dev |tcm | ver | prd&quot;&gt;
          &lt;!--include resource=&quot;com/google/cloud/spring/logging/logback-json-appender.xml&quot;/--&gt;
          &lt;property name=&quot;projectId&quot; value=&quot;${projectId:-${GOOGLE_CLOUD_PROJECT}}&quot;/&gt;
          &lt;appender name=&quot;CONSOLE_JSON&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;
              &lt;encoder class=&quot;ch.qos.logback.core.encoder.LayoutWrappingEncoder&quot;&gt;
                  &lt;layout class=&quot;com.google.cloud.spring.logging.StackdriverJsonLayout&quot;&gt;
                      &lt;!--projectId&gt;${projectId}&lt;/projectId--&gt;
  
                      &lt;!--&lt;includeTraceId&gt;true&lt;/includeTraceId&gt;--&gt;
                      &lt;!--&lt;includeSpanId&gt;true&lt;/includeSpanId&gt;--&gt;
                      &lt;!--&lt;includeLevel&gt;true&lt;/includeLevel&gt;--&gt;
                      &lt;!--&lt;includeThreadName&gt;true&lt;/includeThreadName&gt;--&gt;
                      &lt;!--&lt;includeMDC&gt;true&lt;/includeMDC&gt;--&gt;
                      &lt;!--&lt;includeLoggerName&gt;true&lt;/includeLoggerName&gt;--&gt;
                      &lt;!--&lt;includeFormattedMessage&gt;true&lt;/includeFormattedMessage&gt;--&gt;
                      &lt;!--&lt;includeExceptionInMessage&gt;true&lt;/includeExceptionInMessage&gt;--&gt;
                      &lt;!--&lt;includeContextName&gt;true&lt;/includeContextName&gt;--&gt;
                      &lt;!--&lt;includeMessage&gt;false&lt;/includeMessage&gt;--&gt;
                      &lt;!--&lt;includeException&gt;false&lt;/includeException&gt;--&gt;
                      &lt;!--&lt;serviceContext&gt;
                            &lt;service&gt;service-name&lt;/service&gt;
                            &lt;version&gt;service-version&lt;/version&gt;
                          &lt;/serviceContext&gt;--&gt;
                      &lt;!--&lt;customJson&gt;{&quot;custom-key&quot;: &quot;custom-value&quot;}&lt;/customJson&gt;--&gt;
                  &lt;/layout&gt;
              &lt;/encoder&gt;
          &lt;/appender&gt;
          &lt;root level=&quot;INFO&quot;&gt;
              &lt;appender-ref ref=&quot;CONSOLE_JSON&quot;/&gt;
          &lt;/root&gt;
      &lt;/springProfile&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>anyone had similar issue and managed to fix it?</p>