Skip to content

Commit

Permalink
feat: 1651 web validator retries with bad zip file 2 (#1686)
Browse files Browse the repository at this point in the history
* setup spring cloud gcp logging

* ignore annoying tests

* updated logback

* modified dependencies

* rename the stack driver log package name

* revert: deploy to master

* Detect when the Spring context is deployed in the cloud vs local. In the cloud, use the CONSOLE_JSON appended, and in local STDOUT

* removed useless code

* formatted code

---------

Co-authored-by: David Gamez Diaz <1192523+davidgamez@users.noreply.github.com>
  • Loading branch information
qcdyx and davidgamez authored Mar 6, 2024
1 parent d631b1a commit bf25c9b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
3 changes: 2 additions & 1 deletion web/service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ dependencies {
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'io.sentry:sentry-spring-boot-starter:6.18.1'
implementation 'io.sentry:sentry-logback:6.18.1'
implementation 'com.google.cloud:spring-cloud-gcp-starter-logging:3.7.9'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

dependencyManagement {
imports {
mavenBom "com.google.cloud:spring-cloud-gcp-dependencies:${springCloudGcpVersion}"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

Expand Down
38 changes: 29 additions & 9 deletions web/service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<include resource="org/springframework/boot/logging/logback/base.xml"/>

<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
<springProfile name="local">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</springProfile>

<springProfile name="cloud">
<appender name="CONSOLE_JSON" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="com.google.cloud.spring.logging.StackdriverJsonLayout">
<includeTraceId>true</includeTraceId>
<includeSpanId>true</includeSpanId>
<includeLevel>true</includeLevel>
<includeThreadName>true</includeThreadName>
<includeMDC>true</includeMDC>
<includeLoggerName>true</includeLoggerName>
</layout>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE_JSON" />
</root>
</springProfile>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;

import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down

0 comments on commit bf25c9b

Please sign in to comment.