Moved turning on of autoproxy to properties

This commit is contained in:
Marcin Grzejszczak
2016-02-19 10:10:11 +01:00
parent 0511b04250
commit 4bd484fb21
2 changed files with 3 additions and 2 deletions

View File

@@ -39,14 +39,12 @@ import org.springframework.cloud.sleuth.trace.DefaultTracer;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
/**
* @author Spencer Gibb
*/
@Configuration
@ConditionalOnProperty(value="spring.sleuth.enabled", matchIfMissing=true)
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableConfigurationProperties
public class TraceAutoConfiguration {

View File

@@ -27,6 +27,8 @@ import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertySource;
/**
* Adds a default logging pattern level that prints trace infotmation
*
* @author Dave Syer
*
*/
@@ -42,6 +44,7 @@ public class TraceEnvironmentPostProcessor implements EnvironmentPostProcessor {
// traces in logs without having to configure it.
map.put("logging.pattern.level",
"%clr(%5p) %clr([${spring.application.name:},%X{X-Trace-Id:-},%X{X-Span-Id:-},%X{X-Span-Export:-}]){yellow}");
map.put("spring.aop.proxyTargetClass", "true");
addOrReplace(environment.getPropertySources(), map);
}