Commit 79c236c0 by Johannes Edmeier

Merge branch '1.4.x'

parents 28a80e70 30d76a73
......@@ -84,6 +84,8 @@ public class ApplicationDiscoveryListener {
String applicationId = register(instance);
staleApplicationIds.remove(applicationId);
}
} else {
LOGGER.debug("Ignoring discovered service {}", serviceId);
}
}
for (String staleApplicationId : staleApplicationIds) {
......@@ -107,6 +109,7 @@ public class ApplicationDiscoveryListener {
try {
Application application = converter.convert(instance);
if (application != null) {
LOGGER.debug("Registering discovered application {}", application);
return registry.register(application).getId();
} else {
LOGGER.warn("No application for service {} registered", instance);
......
......@@ -20,6 +20,8 @@ import static org.apache.commons.lang.StringUtils.stripStart;
import java.net.URI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.web.util.UriComponentsBuilder;
......@@ -35,6 +37,8 @@ import de.codecentric.boot.admin.model.Application;
* @author Johannes Edmeier
*/
public class DefaultServiceInstanceConverter implements ServiceInstanceConverter {
private static final Logger LOGGER = LoggerFactory
.getLogger(DefaultServiceInstanceConverter.class);
private static final String KEY_MANAGEMENT_PORT = "management.port";
private static final String KEY_MANAGEMENT_PATH = "management.context-path";
private static final String KEY_HEALTH_PATH = "health.path";
......@@ -43,6 +47,10 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
@Override
public Application convert(ServiceInstance instance) {
LOGGER.debug("Converting service '{}' running at '{}' with metadata {}",
instance.getServiceId(),
instance.getUri(), instance.getMetadata());
Application.Builder builder = Application.create(instance.getServiceId());
URI healthUrl = getHealthUrl(instance);
if (healthUrl != null) {
......
......@@ -51,6 +51,9 @@ public class ConcatenatingResourceResolver extends AbstractResourceResolver {
List<? extends Resource> locations, ResourceResolverChain chain) {
String filename = StringUtils.getFilename(requestPath);
try {
if (logger.isDebugEnabled()) {
logger.debug("Creating concatenated resource '" + filename + "' from " + locations);
}
return new InMemoryFileResource(filename, buildDescription(locations),
getContent(locations), getLastModified(locations));
} catch (IOException ex) {
......
......@@ -33,7 +33,6 @@ import org.springframework.web.servlet.resource.ResourceResolverChain;
* @author Johannes Edmeier
*/
public class PreferMinifiedFilteringResourceResolver extends AbstractResourceResolver {
private final String extensionPrefix;
public PreferMinifiedFilteringResourceResolver(String extensionPrefix) {
......@@ -43,7 +42,7 @@ public class PreferMinifiedFilteringResourceResolver extends AbstractResourceRes
@Override
protected Resource resolveResourceInternal(HttpServletRequest request, String requestPath,
List<? extends Resource> locations, ResourceResolverChain chain) {
List<Resource> newLocations = new ArrayList<Resource>(locations.size());
List<Resource> newLocations = new ArrayList<>(locations.size());
for (Resource location : locations) {
Resource minified = findMinified(location);
......@@ -60,6 +59,10 @@ public class PreferMinifiedFilteringResourceResolver extends AbstractResourceRes
Resource minified = resource
.createRelative(basename + extensionPrefix + '.' + extension);
if (minified.exists()) {
if (logger.isDebugEnabled()) {
logger.debug("Found minified file for '" + resource.getFilename() + "': '"
+ minified.getFilename() + "'");
}
return minified;
}
} catch (IOException ex) {
......
......@@ -50,6 +50,10 @@ public class ResourcePatternResolvingResourceResolver extends AbstractResourceRe
List<? extends Resource> locations, ResourceResolverChain chain) {
try {
Resource[] resources = resourcePatternResolver.getResources(pattern);
if (logger.isDebugEnabled()) {
logger.debug(
"Resolved Resources for '" + pattern + "': " + Arrays.toString(resources));
}
return chain.resolveResource(request, requestPath, Arrays.asList(resources));
} catch (IOException ex) {
throw new ResourceAccessException("Couldn't resolve resources for \"" + pattern + "\"",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment