From c825b607c725b5e0d10d826b65b6a183a81540e7 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Fri, 11 Nov 2016 01:55:55 +0700 Subject: logback configurations are copied --- .../com/juick/ws/configuration/WebsocketConfiguration.java | 11 +++++++++++ juick-ws/src/main/resources/logback.xml | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 juick-ws/src/main/resources/logback.xml (limited to 'juick-ws') diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java index db37edc4..0a2a91fa 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java @@ -9,10 +9,12 @@ import com.mitchellbosecke.pebble.loader.Loader; import com.mitchellbosecke.pebble.loader.ServletLoader; import com.mitchellbosecke.pebble.spring4.PebbleViewResolver; import com.mitchellbosecke.pebble.spring4.extension.SpringExtension; +import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; +import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.env.Environment; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @@ -48,6 +50,15 @@ public class WebsocketConfiguration extends WebMvcConfigurationSupport implement @Inject private ServletContext servletContext; + @Bean + public static PlaceholderConfigurerSupport propertySourcesPlaceholderConfigurer() { + PlaceholderConfigurerSupport configurer = new PropertySourcesPlaceholderConfigurer(); + + configurer.setFileEncoding("utf-8"); + configurer.setOrder(1); + return configurer; + } + @Bean public WebsocketComponent wsHandler() { return new WebsocketComponent(); diff --git a/juick-ws/src/main/resources/logback.xml b/juick-ws/src/main/resources/logback.xml new file mode 100644 index 00000000..9e3bf16c --- /dev/null +++ b/juick-ws/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + \ No newline at end of file -- cgit v1.2.3