mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
improve logging
This commit is contained in:
@@ -37,6 +37,9 @@ package sonia.scm.net;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import sonia.scm.config.ScmConfiguration;
|
import sonia.scm.config.ScmConfiguration;
|
||||||
import sonia.scm.util.Util;
|
import sonia.scm.util.Util;
|
||||||
|
|
||||||
@@ -64,6 +67,10 @@ public class URLHttpClient implements HttpClient
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String ENCODING = "UTF-8";
|
public static final String ENCODING = "UTF-8";
|
||||||
|
|
||||||
|
/** the logger for URLHttpClient */
|
||||||
|
private static final Logger logger =
|
||||||
|
LoggerFactory.getLogger(URLHttpClient.class);
|
||||||
|
|
||||||
//~--- constructors ---------------------------------------------------------
|
//~--- constructors ---------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -237,6 +244,14 @@ public class URLHttpClient implements HttpClient
|
|||||||
|
|
||||||
if (configuration.isEnableProxy())
|
if (configuration.isEnableProxy())
|
||||||
{
|
{
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.debug("fetch '{}' using proxy {}:{}",
|
||||||
|
new Object[] { url.toExternalForm(),
|
||||||
|
configuration.getProxyServer(),
|
||||||
|
configuration.getProxyPort() });
|
||||||
|
}
|
||||||
|
|
||||||
SocketAddress address =
|
SocketAddress address =
|
||||||
new InetSocketAddress(configuration.getProxyServer(),
|
new InetSocketAddress(configuration.getProxyServer(),
|
||||||
configuration.getProxyPort());
|
configuration.getProxyPort());
|
||||||
@@ -245,6 +260,11 @@ public class URLHttpClient implements HttpClient
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.debug("fetch '{}'");
|
||||||
|
}
|
||||||
|
|
||||||
connection = url.openConnection();
|
connection = url.openConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user