Remove blitz4j
fixes gh-527
This commit is contained in:
6
pom.xml
6
pom.xml
@@ -265,12 +265,6 @@
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.2</version>
|
||||
</dependency>
|
||||
<!-- Eureka server dep that is now optional -->
|
||||
<dependency>
|
||||
<groupId>com.netflix.blitz4j</groupId>
|
||||
<artifactId>blitz4j</artifactId>
|
||||
<version>1.36.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
|
||||
@@ -46,10 +46,6 @@
|
||||
<groupId>com.netflix.eureka</groupId>
|
||||
<artifactId>eureka-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.blitz4j</groupId>
|
||||
<artifactId>blitz4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.jersey</groupId>
|
||||
<artifactId>jersey-servlet</artifactId>
|
||||
|
||||
@@ -20,9 +20,7 @@ import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
|
||||
@@ -34,7 +32,6 @@ import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.logging.LoggingSystem;
|
||||
import org.springframework.boot.logging.log4j.Log4JLoggingSystem;
|
||||
import org.springframework.cloud.netflix.eureka.EurekaServerConfigBean;
|
||||
import org.springframework.cloud.netflix.eureka.server.advice.LeaseManagerLite;
|
||||
@@ -49,13 +46,9 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.support.PropertiesLoaderUtils;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
|
||||
import com.netflix.blitz4j.DefaultBlitz4jConfig;
|
||||
import com.netflix.blitz4j.LoggingConfiguration;
|
||||
import com.netflix.discovery.EurekaClient;
|
||||
import com.netflix.eureka.AbstractInstanceRegistry;
|
||||
import com.netflix.eureka.EurekaBootStrap;
|
||||
@@ -92,37 +85,6 @@ public class EurekaServerInitializerConfiguration
|
||||
this.servletContext = servletContext;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void initLogging() {
|
||||
|
||||
if (!(LoggingSystem
|
||||
.get(ClassUtils.getDefaultClassLoader()) instanceof Log4JLoggingSystem)) {
|
||||
|
||||
LoggingConfiguration off = new LoggingConfiguration() {
|
||||
@Override
|
||||
public void configure() {
|
||||
}
|
||||
};
|
||||
Field instance = ReflectionUtils.findField(LoggingConfiguration.class,
|
||||
"instance");
|
||||
ReflectionUtils.makeAccessible(instance);
|
||||
ReflectionUtils.setField(instance, null, off);
|
||||
Field blitz4j = ReflectionUtils.findField(LoggingConfiguration.class,
|
||||
"blitz4jConfig");
|
||||
ReflectionUtils.makeAccessible(blitz4j);
|
||||
try {
|
||||
Properties props = PropertiesLoaderUtils
|
||||
.loadAllProperties(new ClassPathResource("log4j.properties",
|
||||
Log4JLoggingSystem.class).toString());
|
||||
DefaultBlitz4jConfig blit4jConfig = new DefaultBlitz4jConfig(props);
|
||||
ReflectionUtils.setField(blitz4j, off, blit4jConfig);
|
||||
}
|
||||
catch (IOException e) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
new Thread(new Runnable() {
|
||||
@@ -143,7 +105,6 @@ public class EurekaServerInitializerConfiguration
|
||||
catch (IOException ex) {
|
||||
// ignore
|
||||
}
|
||||
LoggingConfiguration.getInstance().configure();
|
||||
EurekaServerConfigurationManager.getInstance()
|
||||
.setConfiguration(
|
||||
EurekaServerInitializerConfiguration.this.eurekaServerConfig);
|
||||
|
||||
@@ -31,8 +31,6 @@ import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.netflix.blitz4j.LoggingConfiguration;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
@@ -56,7 +54,6 @@ public class Log4JLoggingSystemTests {
|
||||
System.setProperty("log4j.configuration", new ClassPathResource(
|
||||
"log4j.properties", Log4JLoggingSystem.class).getURL().toString());
|
||||
this.logger = Logger.getLogger(getClass());
|
||||
LoggingConfiguration.getInstance().configure();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user