-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from perfx/tomcat-fix
Fix late getRequest and getResponse calls in Tomcat
- Loading branch information
Showing
24 changed files
with
534 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...ogging-support-core/src/main/java/com/sap/hcp/cf/logging/common/RequestRecordBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.sap.hcp.cf.logging.common; | ||
|
||
import com.sap.hcp.cf.logging.common.RequestRecord.Direction; | ||
|
||
public class RequestRecordBuilder { | ||
|
||
private final RequestRecord requestRecord; | ||
|
||
private RequestRecordBuilder(String layerKey) { | ||
this.requestRecord = new RequestRecord(layerKey); | ||
} | ||
|
||
private RequestRecordBuilder(String layerKey, Direction direction) { | ||
this.requestRecord = new RequestRecord(layerKey, direction); | ||
} | ||
|
||
public static RequestRecordBuilder requestRecord(String layerKey) { | ||
return new RequestRecordBuilder(layerKey); | ||
} | ||
|
||
public static RequestRecordBuilder requestRecord(String layerKey, Direction direction) { | ||
return new RequestRecordBuilder(layerKey, direction); | ||
} | ||
|
||
public RequestRecord build() { | ||
return requestRecord; | ||
} | ||
|
||
public RequestRecordBuilder addTag(String fieldKey, String tag) { | ||
requestRecord.addTag(fieldKey, tag); | ||
return this; | ||
} | ||
|
||
public RequestRecordBuilder addOptionalTag(boolean optionalFieldCanBeLogged, String fieldKey, String tag) { | ||
|
||
if (!optionalFieldCanBeLogged && tag != null) { | ||
requestRecord.addTag(fieldKey, Defaults.REDACTED); | ||
} | ||
|
||
if (!optionalFieldCanBeLogged && tag.equals(Defaults.UNKNOWN)) { | ||
requestRecord.addTag(fieldKey, tag); | ||
} | ||
|
||
if (optionalFieldCanBeLogged) { | ||
requestRecord.addTag(fieldKey, tag); | ||
} | ||
return this; | ||
} | ||
|
||
public RequestRecordBuilder addContextTag(String fieldKey, String tag) { | ||
requestRecord.addContextTag(fieldKey, tag); | ||
return this; | ||
} | ||
|
||
public RequestRecordBuilder addValue(String fieldKey, Value value) { | ||
requestRecord.addValue(fieldKey, value); | ||
return this; | ||
} | ||
} |
30 changes: 0 additions & 30 deletions
30
...g-support-core/src/main/java/com/sap/hcp/cf/logging/common/RequestRecordConfigurator.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.