Skip to content

Commit 2fff3e1

Browse files
committed
Logback working locally, normal logging in docker compose.
1 parent ab407ad commit 2fff3e1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

cwms-data-api/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ dependencies {
7878
implementation(libs.google.errorProne)
7979
implementation(project(":flogger-cda-context"))
8080
runtimeOnly(libs.google.flogger.system.backend)
81-
runtimeOnly(libs.google.flogger.slf4j.backend) {
82-
exclude group: "org.slf4j"
83-
}
8481

8582
implementation(libs.nucleus.data) {
8683
exclude group: "org.jdom"
@@ -163,10 +160,10 @@ dependencies {
163160
testImplementation(libs.slf4j.jul)
164161
tomcatLibs(libs.google.flogger.api)
165162
tomcatLibs(libs.google.flogger.system.backend)
166-
tomcatLibs(libs.google.flogger.slf4j.backend) {
163+
baseLibs(libs.google.flogger.slf4j.backend) {
167164
exclude group: "org.slf4j"
168165
}
169-
//./gr testRuntimeOnly(libs.slf4j)
166+
170167
baseLibs(libs.ch.qos.logback)
171168

172169
testImplementation(libs.bundles.testcontainers)

cwms-data-api/src/test/resources/tomcat/conf/context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Context cookies="true">
2+
<Context cookies="true" delegate="true">
33
<Resource name="jdbc/CWMS3" auth="Container" type="javax.sql.DataSource"
44
username="${CDA_JDBC_USERNAME}" password="${CDA_JDBC_PASSWORD}"
55
url="${CDA_JDBC_URL}"

flogger-cda-context/src/main/java/cwms/cda/logging/CdaLoggingContext.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.HashMap;
44
import java.util.Map;
5+
import java.util.stream.Collectors;
56

67
import org.slf4j.MDC;
78

@@ -68,9 +69,11 @@ public LoggingContextCloseable install() {
6869

6970
final var tags = this.getTags();
7071
if (tags != null) {
71-
tags.asMap().forEach((key, entry) -> {
72-
MDC.put(key, String.join(",", entry.stream().map(Object::toString).toList()));
73-
});
72+
tags.asMap().forEach((key, entry) ->
73+
MDC.put(key, String.join(",", entry.stream()
74+
.map(Object::toString)
75+
.collect(Collectors.toList())))
76+
);
7477
}
7578

7679
// Just reset back the MDC map to whatever it was before we decided to muck with it.

0 commit comments

Comments
 (0)