Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
LEDfan committed Oct 13, 2023
1 parent 327d866 commit 5ab1a28
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import eu.openanalytics.containerproxy.backend.strategy.IProxyTestStrategy;
import eu.openanalytics.containerproxy.model.runtime.Proxy;
import eu.openanalytics.containerproxy.service.StructuredLogger;
import eu.openanalytics.containerproxy.util.Retrying;

import java.net.HttpURLConnection;
Expand All @@ -31,6 +32,8 @@

public class NotInternalOnlyTestStrategy implements IProxyTestStrategy {

private final StructuredLogger log = StructuredLogger.create(getClass());

@Override
public boolean testProxy(Proxy proxy) {
URI targetURI = proxy.getContainers().get(0).getTargets().get(proxy.getId());
Expand All @@ -48,7 +51,9 @@ public boolean testProxy(Proxy proxy) {
if (Arrays.asList(200, 301, 302, 303, 307, 308).contains(responseCode)) {
return true;
}
log.warn(proxy, "Error during test strategy test: status code: " + responseCode);
} catch (Exception e) {
log.warn(proxy, e, "Exception during test strategy");
return false;
}
return false;
Expand Down

0 comments on commit 5ab1a28

Please sign in to comment.