Skip to content

Commit

Permalink
Add Cleartext sync bug troubleshooting logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Jul 26, 2023
1 parent 9f67c0d commit 1e5a722
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ private void replaceAndCopyResponse(Reader entityContentReader, Writer writer, S
// matching can be done more efficiently if needed, but we should avoid loading the full
// stream in memory.
String fhirStoreUrl = fhirClient.getBaseUrl();

logger.error(
"######################## --- replaceAndCopyResponse --- ###########################");
logger.error(
String.format("Replacing Base URL %s with Proxy Base %s", fhirStoreUrl, proxyBase));
logger.error("###################################################");

int numMatched = 0;
int n;
while ((n = entityContentReader.read()) >= 0) {
Expand Down
16 changes: 16 additions & 0 deletions server/src/main/java/com/google/fhir/gateway/FhirProxyServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.server.ApacheProxyAddressStrategy;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.interceptor.CorsInterceptor;
import com.google.fhir.gateway.GenericFhirClient.GenericFhirClientBuilder;
Expand Down Expand Up @@ -108,6 +109,21 @@ protected void initialize() throws ServletException {
} catch (IOException e) {
ExceptionUtil.throwRuntimeExceptionAndLog(logger, "IOException while initializing", e);
}

logger.error(
"######################## --- initialize BEFORE Setting Address Strategy ---"
+ " ###########################");
logger.error(
String.format("Current Address Strategy class %s", this.getServerAddressStrategy()));
logger.error("###################################################\n");

setServerAddressStrategy(new ApacheProxyAddressStrategy(true));

logger.error(
"######################## --- initialize AFTER Setting Address Strategy ---"
+ " ###########################");
logger.error(String.format("New Address Strategy class %s", this.getServerAddressStrategy()));
logger.error("###################################################\n");
}

private HttpFhirClient chooseHttpFhirClient(String backendType, String fhirStore)
Expand Down

0 comments on commit 1e5a722

Please sign in to comment.