spring boot logging 설정

spring boot logging 설정 저번에는 spring logging에 대해서 알아봤다. 이번에는 설정에 대해 알아볼려고 한다. 아래는 boot의 기본 설정으로 되어있는 로그 포맷이다. 2016-03-15 12:31:52.479 INFO 602 — [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2016-03-15 12:31:52.480 INFO 602 — [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2016-03-15 12:31:52.573 INFO 602 — [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL.. Read More

spring Aware 순서

spring Aware order 이건 메모 추후에 다신 확인 AbstractApplicationContext finishBeanFactoryInitialization(beanFactory) AbstractAutowireCapableBeanFactory 클래스에서 아래와 같이 셋팅 BeanNameAware BeanClassLoaderAware BeanFactoryAware private void invokeAwareMethods(final String beanName, final Object bean) { if (bean instanceof Aware) { if (bean instanceof BeanNameAware) { ((BeanNameAware) bean).setBeanName(beanName); } if (bean instanceof BeanClassLoaderAware) { ((BeanClassLoaderAware) bean).setBeanClassLoader(getBeanClassLoader()); } if (bean instanceof BeanFactoryAware) { ((BeanFactoryAware) bean).setBeanFactory(AbstractAutowireCapableBeanFactory.this); } } } ApplicationContextAwareProcessor 클래스에서 아래와 같이 셋팅 EnvironmentAware EmbeddedValueResolverAware ResourceLoaderAware ApplicationEventPublisherAware MessageSourceAware ApplicationContextAware private.. Read More

Spring boot와 Docker Postgresql

Spring boot와 Docker Postgresql 이번엔 docker와 posrgresql에 대해 알아보겠다. 1. centos 6에 docker를 설치해보자 2. Spring boot와 Docker 3. Spring boot와 Docker Mysql mysql과 소스는 동일하다. @SpringBootApplication public class SpringBootDockerPostgresqlApplication { public static void main(String[] args) { SpringApplication.run(SpringBootDockerPostgresqlApplication.class, args); } @Autowired private AccountRepository repository; @Bean CommandLineRunner runner() { return args -> Arrays.asList( new Account(1L,”wonwoo”,”wonwoo@test.com”), new Account(2L,”kevin”,”kevin@test.com”), new Account(3L,”mink”,”mink@test.com”) ).forEach(repository::save); } } Account class @Entity @Data @NoArgsConstructor @AllArgsConstructor public class Account.. Read More