remove log4j dependencies (#1675)

* upgrade to spring boot 1.5.2

* add full update to REST API

* modify ratings controller

* upgrade herold

* fix integration test

* fix integration test

* minor fix

* fix integration test

* fix integration test

* minor cleanup

* minor cleanup

* remove log4j properties

* use standard logbook.xml

* remove log4j dependencies
This commit is contained in:
Doha2012
2017-04-18 22:39:14 +02:00
committed by Grzegorz Piwowarek
parent a5f4ae927d
commit 74688cf30e
59 changed files with 63 additions and 414 deletions
@@ -2,14 +2,16 @@ package org.baeldung.scopes;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class ScopesController {
public static final Logger LOG = Logger.getLogger(ScopesController.class);
public static final Logger LOG = LoggerFactory.getLogger(ScopesController.class);
@Resource(name = "requestMessage")
HelloMessageGenerator requestMessage;
@@ -1,6 +1,8 @@
package org.baeldung.startup;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@@ -11,7 +13,7 @@ import javax.annotation.PostConstruct;
@Scope(value = "prototype")
public class AllStrategiesExampleBean implements InitializingBean {
private static final Logger LOG = Logger.getLogger(AllStrategiesExampleBean.class);
private static final Logger LOG = LoggerFactory.getLogger(AllStrategiesExampleBean.class);
public AllStrategiesExampleBean() {
LOG.info("Constructor");
@@ -1,13 +1,15 @@
package org.baeldung.startup;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
@Component
public class EventListenerExampleBean {
private static final Logger LOG = Logger.getLogger(EventListenerExampleBean.class);
private static final Logger LOG = LoggerFactory.getLogger(EventListenerExampleBean.class);
public static int counter;
@@ -1,23 +1,24 @@
package org.baeldung.startup;
import org.apache.log4j.Logger;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import java.util.Arrays;
@Component
@Scope(value = "prototype")
public class InitMethodExampleBean {
private static final Logger LOG = Logger.getLogger(InitMethodExampleBean.class);
private static final Logger LOG = LoggerFactory.getLogger(InitMethodExampleBean.class);
@Autowired
private Environment environment;
public void init() {
LOG.info(Arrays.asList(environment.getDefaultProfiles()));
LOG.info("Env Default Profiles", Arrays.asList(environment.getDefaultProfiles()));
}
}
@@ -1,25 +1,26 @@
package org.baeldung.startup;
import org.apache.log4j.Logger;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import java.util.Arrays;
@Component
@Scope(value = "prototype")
public class InitializingBeanExampleBean implements InitializingBean {
private static final Logger LOG = Logger.getLogger(InitializingBeanExampleBean.class);
private static final Logger LOG = LoggerFactory.getLogger(InitializingBeanExampleBean.class);
@Autowired
private Environment environment;
@Override
public void afterPropertiesSet() throws Exception {
LOG.info(Arrays.asList(environment.getDefaultProfiles()));
LOG.info("Env Default Profiles", Arrays.asList(environment.getDefaultProfiles()));
}
}
@@ -1,25 +1,22 @@
package org.baeldung.startup;
import org.apache.log4j.Logger;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import java.util.Arrays;
@Component
@Scope(value = "prototype")
public class LogicInConstructorExampleBean {
private static final Logger LOG = Logger.getLogger(LogicInConstructorExampleBean.class);
private final Environment environment;
private static final Logger LOG = LoggerFactory.getLogger(LogicInConstructorExampleBean.class);
@Autowired
public LogicInConstructorExampleBean(Environment environment) {
this.environment = environment;
LOG.info(Arrays.asList(environment.getDefaultProfiles()));
LOG.info("Env Default Profiles", Arrays.asList(environment.getDefaultProfiles()));
}
}
@@ -1,25 +1,27 @@
package org.baeldung.startup;
import org.apache.log4j.Logger;
import java.util.Arrays;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Arrays;
@Component
@Scope(value = "prototype")
public class PostConstructExampleBean {
private static final Logger LOG = Logger.getLogger(PostConstructExampleBean.class);
private static final Logger LOG = LoggerFactory.getLogger(PostConstructExampleBean.class);
@Autowired
private Environment environment;
@PostConstruct
public void init() {
LOG.info(Arrays.asList(environment.getDefaultProfiles()));
LOG.info("Env Default Profiles", Arrays.asList(environment.getDefaultProfiles()));
}
}
@@ -1,6 +1,8 @@
package org.baeldung.startup;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
@@ -8,7 +10,7 @@ import org.springframework.stereotype.Component;
@Component
public class StartupApplicationListenerExample implements ApplicationListener<ContextRefreshedEvent> {
private static final Logger LOG = Logger.getLogger(StartupApplicationListenerExample.class);
private static final Logger LOG = LoggerFactory.getLogger(StartupApplicationListenerExample.class);
public static int counter;