Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Defaulting to non-proxy environment" log warning #172

Open
worpet opened this issue Jul 9, 2020 · 4 comments
Open

"Defaulting to non-proxy environment" log warning #172

worpet opened this issue Jul 9, 2020 · 4 comments

Comments

@worpet
Copy link

worpet commented Jul 9, 2020

We frequently see lines with this message in our logs:

WARN Defaulting to non-proxy environment

We have traced the source of these to the below Authorize.net code:

if (UseProxy && ProxyHost != null) {
HttpClientBuilder hcBuilder;
if (proxyUsername != null && proxyPassword != null) {
LogHelper.info(logger, "Setting up proxy to URL with Authentication: '%s://%s@%s:%d'",
Constants.PROXY_PROTOCOL, proxyUsername, ProxyHost, ProxyPort);
CredentialsProvider credsProvider = new BasicCredentialsProvider();
AuthScope proxyScope = new AuthScope(ProxyHost, ProxyPort);
Credentials proxyCreds = new UsernamePasswordCredentials(proxyUsername, proxyPassword);
credsProvider.setCredentials(proxyScope, proxyCreds);
hcBuilder = HttpClients.custom().setSSLSocketFactory(sslSocketFactory)
.setDefaultRequestConfig(requestConfig).setRedirectStrategy(new LaxRedirectStrategy())
.setDefaultCredentialsProvider(credsProvider);
} else {
LogHelper.info(logger, "Setting up proxy to URL: '%s://%s:%d'", Constants.PROXY_PROTOCOL, ProxyHost,
ProxyPort);
hcBuilder = HttpClients.custom().setSSLSocketFactory(sslSocketFactory)
.setDefaultRequestConfig(requestConfig).setRedirectStrategy(new LaxRedirectStrategy());
}
HttpHost httpProxy = new HttpHost(ProxyHost, ProxyPort, Constants.PROXY_PROTOCOL);
hcBuilder.setProxy(httpProxy);
httpClient = hcBuilder.build();
proxySet = true;
} else {
LogHelper.warn(logger, "Defaulting to non-proxy environment");
httpClient = HttpClients.custom().setSSLSocketFactory(sslSocketFactory)
.setDefaultRequestConfig(requestConfig).setRedirectStrategy(new LaxRedirectStrategy()).build();
}

It seems like this should be an INFO rather than a WARN. We want to keep our log threshold at WARN to be able to see potential problems, but then we end up with mostly these "non-proxy environment" lines.

Found others complaining here: https://community.developer.authorize.net/t5/Integration-and-Testing/quot-Non-proxy-quot-from-AuthNet-SDK-is-spamming-our-logs/td-p/71855.

@johnstrickler
Copy link

I'd take this a step further and say this should be a DEBUG statement.

@BlackPenguins
Copy link

Agreed. Raising the log level to hide spam and mask real issues is not a solution. And this is literally a ONE line fix. Why has this not been addressed yet?

@subnetmarco
Copy link

I agree should be DEBUG, or at the very least INFO, certainly not a WARN.

This would be a useful fix, @gnongsie any intention to move forward with it?

@subnetmarco
Copy link

In the meantime the following configuration will skip the WARN spam and only capture ERROR and above:

logging.level.net.authorize.util.HttpClient=ERROR

shalin-shaji added a commit that referenced this issue Sep 23, 2024
….Changed the condition to reach the mentioned log message.
shalin-shaji added a commit that referenced this issue Sep 23, 2024
…. Changed the condition to reach the mentioned log message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants