package org.springframework.cloud.netflix.eureka.server;

import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.eureka.EurekaServerConfigBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.google.common.collect.Lists;
import com.sun.jersey.spi.container.servlet.ServletContainer;

/**
 *
 * @author Gunnar Hillert
 *
 */
@Configuration
@Import(EurekaServerInitializerConfiguration.class)
@EnableEurekaClient
public class EurekaServerConfiguration extends WebMvcConfigurerAdapter {
	
	@Bean
	public EurekaController eurekaController() {
		return new EurekaController();
	}

	@Bean
	public FilterRegistrationBean jersey() {
		FilterRegistrationBean bean = new FilterRegistrationBean();
		bean.setFilter(new ServletContainer());
		bean.setOrder(Ordered.LOWEST_PRECEDENCE);
		bean.addInitParameter("com.sun.jersey.config.property.WebPageContentRegex", EurekaServerConfigBean.DEFAULT_PREFIX + "/(fonts|images|css)/.*");
		bean.addInitParameter("com.sun.jersey.config.property.packages",
				"com.netflix.discovery;com.netflix.eureka");
		bean.setUrlPatterns(Lists.newArrayList(EurekaServerConfigBean.DEFAULT_PREFIX + "/*"));
		return bean;
	}

}

@@ -47,24 +47,117 @@
 ka.server;%0A%0A
+import javax.servlet.Filter;%0A%0Aimport org.springframework.beans.factory.annotation.Qualifier;%0A
 import org.s
@@ -951,17 +951,16 @@
 apter %7B%0A
-%09
 %0A%09@Bean%0A
@@ -1316,17 +1316,21 @@
 tRegex%22,
- 
+%0A%09%09%09%09
 EurekaSe
@@ -1578,25 +1578,29 @@
 FAULT_PREFIX
- 
+%0A%09%09%09%09
 + %22/*%22));%0A%09%09
@@ -1616,10 +1616,286 @@
 an;%0A%09%7D%0A%0A
+%09@Bean%0A%09public FilterRegistrationBean traceFilterRegistration(%0A%09%09%09@Qualifier(%22webRequestLoggingFilter%22) Filter filter) %7B%0A%09%09FilterRegistrationBean bean = new FilterRegistrationBean();%0A%09%09bean.setFilter(filter);%0A%09%09bean.setOrder(Ordered.LOWEST_PRECEDENCE - 10);%0A%09%09return bean;%0A%09%7D%0A
 %7D%0A

Add back trace filter