protected void collectTraceId(final StringMap contextData) {
        if (StringUtils.isNotBlank(this.projectId)) {
            TRACE_ID_MDC_FIELDS
                .stream()
                .map(MDC::get)
                .filter(StringUtils::isNotBlank)
                .findFirst()
                .ifPresent(traceId -> contextData.putValue(StackdriverTraceConstants.MDC_FIELD_TRACE_ID,
                    StackdriverTraceConstants.composeFullTraceName(this.projectId, formatTraceId(traceId))));
        }
    }
Build google cloud appender.

@param name           the name
@param projectId      the project id
@param flattenMessage the flatten message
@param appenderRef    the appender ref
@param filter         the filter
@param config         the config
@return the google cloud appender
support/cas-server-support-gcp-logging/src/main/java/org/apereo/cas/logging/GoogleCloudAppender.java