Skip to content

Commit 8e76c9d

Browse files
Merge branch 'async'
Signed-off-by: Karsten Schnitter <[email protected]>
2 parents db9ffd6 + 01076fa commit 8e76c9d

File tree

23 files changed

+726
-278
lines changed

23 files changed

+726
-278
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ All in all, you should do the following:
2727
* adjust your logging configuration accordingly.
2828

2929

30-
Say, you want to make use of the *servlet filter* feature, then you need to add the following dependency to your POM with property `cf-logging-version` referring to the latest nexus version (currently `2.1.5`):
30+
Say, you want to make use of the *servlet filter* feature, then you need to add the following dependency to your POM with property `cf-logging-version` referring to the latest nexus version (currently `2.2.0`):
3131

3232
```xml
3333
<properties>

cf-java-logging-support-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<parent>
3333
<groupId>com.sap.hcp.cf.logging</groupId>
3434
<artifactId>cf-java-logging-support-parent</artifactId>
35-
<version>2.1.5</version>
35+
<version>2.2.0</version>
3636
<relativePath>../pom.xml</relativePath>
3737
</parent>
3838
<build>

cf-java-logging-support-core/src/main/java/com/sap/hcp/cf/logging/common/RequestRecord.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.sap.hcp.cf.logging.common;
22

3-
import java.io.Closeable;
43
import java.util.HashMap;
54
import java.util.HashSet;
65
import java.util.Map;
@@ -39,7 +38,7 @@
3938
*
4039
*
4140
*/
42-
public class RequestRecord implements Closeable {
41+
public class RequestRecord {
4342

4443
/*
4544
* -- default values for request fields that are marked as "required"
@@ -100,7 +99,6 @@ public RequestRecord(String layerKey, Direction direction) {
10099
addTag(Fields.DIRECTION, direction.toString());
101100
setDefaults();
102101
start();
103-
RequestRecordHolder.add(this);
104102
}
105103

106104
/**
@@ -198,11 +196,6 @@ public long stop() {
198196
return endMs;
199197
}
200198

201-
@Override
202-
public void close() {
203-
RequestRecordHolder.remove(this);
204-
}
205-
206199
@Override
207200
public String toString() {
208201
/*

cf-java-logging-support-core/src/main/java/com/sap/hcp/cf/logging/common/RequestRecordHolder.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

cf-java-logging-support-core/src/test/java/com/sap/hcp/cf/logging/common/RequestRecordConfiguratorTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public void testAddingSingleActivatedOptionalTagToRequestRecord() throws JSONObj
2020
String tag = "TestTag";
2121

2222
to(requestRecord).addOptionalTag(canBeLogged, key, tag);
23-
requestRecord.close();
2423

2524
assertEquals(tag, getFieldFromRequestRecord(requestRecord, key));
2625
}
@@ -33,7 +32,6 @@ public void testAddingSingleForbiddenOptionalTagToRequestRecord() throws JSONObj
3332
String tag = "TestTag";
3433

3534
to(requestRecord).addOptionalTag(canBeLogged, key, tag);
36-
requestRecord.close();
3735

3836
assertEquals(Defaults.REDACTED, getFieldFromRequestRecord(requestRecord, key));
3937
}
@@ -46,7 +44,6 @@ public void testAddingSingleForbiddenOptionalNullTagToRequestRecord() throws JSO
4644
String tag = Defaults.UNKNOWN;
4745

4846
to(requestRecord).addOptionalTag(canBeLogged, key, tag);
49-
requestRecord.close();
5047

5148
assertEquals(Defaults.UNKNOWN, getFieldFromRequestRecord(requestRecord, key));
5249
}
@@ -59,7 +56,6 @@ public void testAddingSingleActivatedOptionalNullTagToRequestRecord() throws JSO
5956
String tag = Defaults.UNKNOWN;
6057

6158
to(requestRecord).addOptionalTag(canBeLogged, key, tag);
62-
requestRecord.close();
6359

6460
assertEquals(Defaults.UNKNOWN, getFieldFromRequestRecord(requestRecord, key));
6561
}

cf-java-logging-support-core/src/test/java/com/sap/hcp/cf/logging/common/converter/TestJsonMessageConverter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public void testLogRecordMsgNotFlattened() {
5858
RequestRecord lrec = new RequestRecord(LOG_PROVIDER);
5959
String lmsg = lrec.toString();
6060
assertThat(formatMsg(jmc, lmsg), is(lmsg));
61-
lrec.close();
6261
}
6362

6463
@Test
@@ -68,7 +67,6 @@ public void testLogRecordMsgFlattened() {
6867
RequestRecord lrec = new RequestRecord(LOG_PROVIDER);
6968
String lmsg = lrec.toString();
7069
assertThat(formatMsg(jmc, lmsg), is(lmsg.substring(1, lmsg.length() - 1)));
71-
lrec.close();
7270
}
7371

7472
@Test

cf-java-logging-support-jersey/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<relativePath>../pom.xml</relativePath>
1010
<groupId>com.sap.hcp.cf.logging</groupId>
1111
<artifactId>cf-java-logging-support-parent</artifactId>
12-
<version>2.1.5</version>
12+
<version>2.2.0</version>
1313
</parent>
1414

1515
<name>cf-java-logging-support-jersey</name>

cf-java-logging-support-jersey/src/main/java/com/sap/hcp/cf/logging/jersey/filter/ResponseHandler.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ public void handle(ResponseContextAdapter responseContext, RequestRecord rr) {
2020
rr.addValue(Fields.RESPONSE_STATUS, new LongValue(responseContext.getStatus()));
2121
rr.stop();
2222
LOGGER.info(Markers.REQUEST_MARKER, "{}", rr);
23-
/*
24-
* -- close this instance
25-
*/
26-
rr.close();
2723
} else {
2824
LOGGER.error("No record found to handle response {}", responseContext);
2925
}

cf-java-logging-support-log4j2/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<relativePath>../pom.xml</relativePath>
1212
<groupId>com.sap.hcp.cf.logging</groupId>
1313
<artifactId>cf-java-logging-support-parent</artifactId>
14-
<version>2.1.5</version>
14+
<version>2.2.0</version>
1515
</parent>
1616

1717
<dependencies>

cf-java-logging-support-log4j2/src/test/java/com/sap/hcp/cf/log4j2/converter/TestJsonMessageConverter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public void testLogRecordMsgNotFlattened() {
5656
RequestRecord lrec = new RequestRecord(LOG_PROVIDER);
5757
String lmsg = lrec.toString();
5858
assertThat(format(jmc, makeEvent(lmsg, NO_ARGS)), is(lmsg));
59-
lrec.close();
6059
}
6160

6261
@Test
@@ -65,7 +64,6 @@ public void testLogRecordMsgFlattened() {
6564
RequestRecord lrec = new RequestRecord(LOG_PROVIDER);
6665
String lmsg = lrec.toString();
6766
assertThat(format(jmc, makeEvent(lmsg, NO_ARGS)), is(lmsg.substring(1, lmsg.length() - 1)));
68-
lrec.close();
6967
}
7068

7169
@Test

0 commit comments

Comments
 (0)