Skip to content

Commit

Permalink
Merge pull request #308 from DP-3T/feature/versionup-logrelay
Browse files Browse the repository at this point in the history
Spring version up. Add Logrelay
  • Loading branch information
martinalig committed Sep 6, 2021
2 parents 87b8288 + 0df2e02 commit 8103468
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 95 deletions.
2 changes: 1 addition & 1 deletion dpppt-backend-sdk/dpppt-backend-sdk-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.dpppt</groupId>
<artifactId>dpppt-backend-sdk</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.1-SNAPSHOT</version>
</parent>
<artifactId>dpppt-backend-sdk-data</artifactId>
<name>DP3T Backend SDK Data</name>
Expand Down
2 changes: 1 addition & 1 deletion dpppt-backend-sdk/dpppt-backend-sdk-interops/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.dpppt</groupId>
<artifactId>dpppt-backend-sdk</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.1-SNAPSHOT</version>
</parent>
<artifactId>dpppt-backend-sdk-interops</artifactId>
<name>DP3T Backend SDK Interops Service</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@

@Configuration
@ConfigurationPropertiesScan("org.dpppt.backend.sdk.interops.model")
@ComponentScan(basePackages = {"org.dpppt.backend.sdk.interops.config"})
@ComponentScan(
basePackages = {
"org.dpppt.backend.sdk.interops.config",
"ch.admin.bag.covidcertificate.log",
"ch.admin.bag.covidcertificate.rest"
})
@EnableAutoConfiguration(
exclude = {SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class})
@EnableWebMvc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#
# SPDX-License-Identifier: MPL-2.0
#
spring.profiles.active=prod
spring.profiles.active=prod,local
spring.application.name=dp3t-insterops-sync-service
management.endpoints.enabled-by-default=false
server.error.whitelabel.enabled=true
#-------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Copyright (c) 2020 Ubique Innovation AG <https://www.ubique.ch>
~
~ This Source Code Form is subject to the terms of the Mozilla Public
~ License, v. 2.0. If a copy of the MPL was not distributed with this
~ file, You can obtain one at https://mozilla.org/MPL/2.0/.
~
~ SPDX-License-Identifier: MPL-2.0
-->

<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>

<property resource="application.properties"/>
<springProperty scope="context" name="springAppName" source="spring.application.name"/>
<property name="LOG_FILE" value="${springAppName}"/>

<!-- You can override this to have a custom pattern -->
<!-- Make sure not to remove LOG_LEVEL_PATTERN, as it's needed by Sleuth -->
<property name="CONSOLE_LOG_PATTERN"
value="%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>


<!-- Appender to log to console -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<!-- Minimum logging level to be presented in the console logs-->
<level>DEBUG</level>
</filter>
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
</appender>

<!-- Appender to log to file -->
<appender name="flatfile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.gz</fileNamePattern>
<maxHistory>7</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>512KB</MaxFileSize>
</triggeringPolicy>
</appender>
<logger name="org.dpppt" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="flatfile"/>
</root>

</configuration>

This file was deleted.

2 changes: 1 addition & 1 deletion dpppt-backend-sdk/dpppt-backend-sdk-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.dpppt</groupId>
<artifactId>dpppt-backend-sdk</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.1-SNAPSHOT</version>
</parent>
<artifactId>dpppt-backend-sdk-model</artifactId>
<name>DP3T Backend SDK Model</name>
Expand Down
4 changes: 2 additions & 2 deletions dpppt-backend-sdk/dpppt-backend-sdk-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.dpppt</groupId>
<artifactId>dpppt-backend-sdk</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.1-SNAPSHOT</version>
</parent>
<artifactId>dpppt-backend-sdk-report</artifactId>
<name>DP3T Backend SDK Report</name>
Expand All @@ -42,7 +42,7 @@
<dependency>
<groupId>org.dpppt</groupId>
<artifactId>dpppt-backend-sdk-ws</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.1-SNAPSHOT</version>
</dependency>

</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion dpppt-backend-sdk/dpppt-backend-sdk-ws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.dpppt</groupId>
<artifactId>dpppt-backend-sdk</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.1-SNAPSHOT</version>
</parent>
<artifactId>dpppt-backend-sdk-ws</artifactId>
<name>DP3T Backend SDK WS</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@Configuration
@ComponentScan(basePackages = {"org.dpppt.backend.sdk.ws.config"})
@ComponentScan(
basePackages = {
"org.dpppt.backend.sdk.ws.config",
"ch.admin.bag.covidcertificate.log",
"ch.admin.bag.covidcertificate.rest"
})
@EnableAutoConfiguration(
exclude = {SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class})
@EnableWebMvc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# SPDX-License-Identifier: MPL-2.0
#

spring.profiles.active=prod
spring.profiles.active=prod,local
spring.application.name=dp3t-backend-service
management.endpoints.enabled-by-default=false
server.error.whitelabel.enabled=true
#-------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Copyright (c) 2020 Ubique Innovation AG <https://www.ubique.ch>
~
~ This Source Code Form is subject to the terms of the Mozilla Public
~ License, v. 2.0. If a copy of the MPL was not distributed with this
~ file, You can obtain one at https://mozilla.org/MPL/2.0/.
~
~ SPDX-License-Identifier: MPL-2.0
-->

<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>

<property resource="application.properties"/>
<springProperty scope="context" name="springAppName" source="spring.application.name"/>
<property name="LOG_FILE" value="${springAppName}"/>

<!-- You can override this to have a custom pattern -->
<!-- Make sure not to remove LOG_LEVEL_PATTERN, as it's needed by Sleuth -->
<property name="CONSOLE_LOG_PATTERN"
value="%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>


<!-- Appender to log to console -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<!-- Minimum logging level to be presented in the console logs-->
<level>DEBUG</level>
</filter>
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
</appender>

<!-- Appender to log to file -->
<appender name="flatfile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.gz</fileNamePattern>
<maxHistory>7</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>512KB</MaxFileSize>
</triggeringPolicy>
</appender>
<logger name="org.dpppt" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="flatfile"/>
</root>

</configuration>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan(basePackages = {"org.dpppt.backend.sdk.ws.config"})
@ComponentScan(
basePackages = {
"org.dpppt.backend.sdk.ws.config",
"ch.admin.bag.covidcertificate.log",
"ch.admin.bag.covidcertificate.rest"
})
@SpringBootApplication
public class TestApplication {}
13 changes: 9 additions & 4 deletions dpppt-backend-sdk/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- ~ Copyright (c) 2020 Ubique Innovation AG <https://www.ubique.ch> ~
<!-- ~ Copyright (c) 2020 Ubique Innovation AG <https://www.ubique.ch> ~
~ This Source Code Form is subject to the terms of the Mozilla Public ~ License,
v. 2.0. If a copy of the MPL was not distributed with this ~ file, You can
obtain one at https://mozilla.org/MPL/2.0/. ~ ~ SPDX-License-Identifier:
Expand All @@ -13,7 +13,7 @@
<groupId>org.dpppt</groupId>
<artifactId>dpppt-backend-sdk</artifactId>
<packaging>pom</packaging>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.1-SNAPSHOT</version>
<name>DP3T Backend SDK</name>

<properties>
Expand All @@ -25,8 +25,8 @@
<jackson-version>2.11.1</jackson-version>
<jsonwebtoken-version>0.11.2</jsonwebtoken-version>
<protobuf-java-version>3.12.1</protobuf-java-version>
<spring-boot-version>2.4.5</spring-boot-version>
<testcontainers-version>1.15.2</testcontainers-version>
<spring-boot-version>2.4.10</spring-boot-version>
<testcontainers-version>1.16.0</testcontainers-version>
<spring-cloud-connectors-version>2.0.7.RELEASE</spring-cloud-connectors-version>

<itCoverageAgent></itCoverageAgent>
Expand Down Expand Up @@ -125,6 +125,11 @@
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>ch.admin.bag.covidcertificate</groupId>
<artifactId>cc-backend-logging</artifactId>
<version>1.0.0</version>
</dependency>

<dependency>
<groupId>com.google.protobuf</groupId>
Expand Down

0 comments on commit 8103468

Please sign in to comment.