Skip to content

Commit

Permalink
feat: add logging management (#490)
Browse files Browse the repository at this point in the history
* feat: add logging management

* chore: opt doc logging
  • Loading branch information
Thomgrus authored Sep 2, 2021
1 parent 0225fdd commit 0469397
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 20 deletions.
2 changes: 1 addition & 1 deletion charts/candidate/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: ara
version: 9.2.1-rc.2
version: 9.3.0-rc.1
home: https://github.com/Decathlon/ara
description: |
ARA helps you to fight against regressions by letting it preanalyze your non-regression tests runs,
Expand Down
2 changes: 1 addition & 1 deletion charts/candidate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ api:
image:
registry: docker.io
repository: decathlon/ara-api
tag: 10.0.2
tag: 10.1.0
imagePullPolicy: IfNotPresent
replicas: 1
annotations: {}
Expand Down
27 changes: 17 additions & 10 deletions code/api/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>com.decathlon.ara</groupId>
<artifactId>ara-api</artifactId>
<version>10.0.2</version>
<version>10.1.0</version>

<name>ARA API</name>
<description>
Expand All @@ -39,7 +39,7 @@
<properties>
<java.version>16</java.version>
<ara.default.database>h2</ara.default.database>
<spring.profiles.active />
<spring.profiles.active>logging-console</spring.profiles.active>
<mapstruct.version>1.4.2.Final</mapstruct.version>
<springdoc.version>1.5.9</springdoc.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -67,6 +67,13 @@
<artifactId>micrometer-registry-influx</artifactId>
</dependency>

<!-- LOGS -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-logging</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>

<!-- Tests and development -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -386,17 +393,10 @@
</build>

<profiles>
<profile>
<id>int</id>
<properties>
<ara.default.database>postgresql</ara.default.database>
</properties>
</profile>

<profile>
<id>dev</id>
<properties>
<spring.profiles.active>dev</spring.profiles.active>
<spring.profiles.active>dev,logging-console</spring.profiles.active>
<!-- skip javadoc, tests, jacoco, lombok for dev profile -->
<maven.javadoc.skip>true</maven.javadoc.skip>
<!-- skip tests, but need to define it on each sub module-->
Expand All @@ -409,6 +409,13 @@
</properties>
</profile>

<profile>
<id>int</id>
<properties>
<ara.default.database>postgresql</ara.default.database>
</properties>
</profile>

</profiles>

</project>
22 changes: 22 additions & 0 deletions code/api/api/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />

<springProfile name="logging-json">
<include resource="org/springframework/cloud/gcp/logging/logback-json-appender.xml"/>
<root level="INFO">
<appender-ref ref="CONSOLE_JSON"/>
</root>
</springProfile>
<springProfile name="logging-api">
<include resource="org/springframework/cloud/gcp/logging/logback-appender.xml"/>
<root level="INFO">
<appender-ref ref="STACKDRIVER"/>
</root>
</springProfile>
<springProfile name="logging-console | default">
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
</springProfile>
</configuration>
2 changes: 1 addition & 1 deletion code/api/database/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>com.decathlon.ara</groupId>
<artifactId>ara-database</artifactId>
<version>10.0.2</version>
<version>10.1.0</version>

<name>ARA Database</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion code/api/generated-cucumber-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<groupId>com.decathlon.ara</groupId>
<artifactId>ara-generated-cucumber-report</artifactId>
<version>10.0.2</version>
<version>10.1.0</version>

<name>ARA Cucumber</name>
<description>
Expand Down
4 changes: 2 additions & 2 deletions code/api/jacoco-aggregation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<parent>
<artifactId>ara-parent</artifactId>
<groupId>com.decathlon.ara</groupId>
<version>10.0.2</version>
<version>10.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>com.decathlon.ara</groupId>
<artifactId>jacoco-aggregation</artifactId>
<packaging>pom</packaging>
<version>10.0.2</version>
<version>10.1.0</version>

<name>Jacoco Report Aggregation</name>

Expand Down
2 changes: 1 addition & 1 deletion code/api/lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<groupId>com.decathlon.ara</groupId>
<artifactId>ara-lib</artifactId>
<version>10.0.2</version>
<version>10.1.0</version>

<properties>
<java.version>16</java.version>
Expand Down
2 changes: 1 addition & 1 deletion code/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<groupId>com.decathlon.ara</groupId>
<artifactId>ara-parent</artifactId>
<packaging>pom</packaging>
<version>10.0.2</version>
<version>10.1.0</version>

<name>ARA Parent</name>
<description>
Expand Down
11 changes: 9 additions & 2 deletions code/core-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<properties>
<java.version>16</java.version>
<ara.default.database>h2</ara.default.database>
<spring.profiles.active />
<spring.profiles.active>logging-console</spring.profiles.active>
<sonar.projectName>ARA core-api</sonar.projectName>
<sonar.projectKey>decathlon_ara_core-api</sonar.projectKey>
<sonar.organization>decathlon</sonar.organization>
Expand Down Expand Up @@ -73,6 +73,13 @@
<scope>runtime</scope>
</dependency>

<!-- LOGS -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-logging</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
Expand Down Expand Up @@ -146,7 +153,7 @@
<profile>
<id>dev</id>
<properties>
<spring.profiles.active>dev</spring.profiles.active>
<spring.profiles.active>dev,logging-console</spring.profiles.active>
<!-- skip tests, but need to define it on each sub module-->
<maven.test.skip>true</maven.test.skip>
<!-- no jacoco for dev profile -->
Expand Down
22 changes: 22 additions & 0 deletions code/core-api/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />

<springProfile name="logging-json">
<include resource="org/springframework/cloud/gcp/logging/logback-json-appender.xml"/>
<root level="INFO">
<appender-ref ref="CONSOLE_JSON"/>
</root>
</springProfile>
<springProfile name="logging-api">
<include resource="org/springframework/cloud/gcp/logging/logback-appender.xml"/>
<root level="INFO">
<appender-ref ref="STACKDRIVER"/>
</root>
</springProfile>
<springProfile name="logging-console | default">
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
</springProfile>
</configuration>
9 changes: 9 additions & 0 deletions doc/tech/LOGGING.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
= Logging

== API

You can use many logging management systems using different Spring profiles:

* console with `logging-console`
* json with `logging-json`
* gcp stackdriver with `logging-api`

0 comments on commit 0469397

Please sign in to comment.