From 499e4e89cb68c99547df5632df358847b62ccc3f Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Thu, 9 Aug 2018 17:14:09 +0200 Subject: Fix logback.xml location The logback.xml location was not working, it was not possible to specify an external logback.xml file. Now it works from application.properties Issue-ID: CLAMP-179 Change-Id: I87c9be70561fc0897b5c6499a431f7cd788c1867 Signed-off-by: Determe, Sebastien (sd378r) --- src/main/java/org/onap/clamp/clds/Application.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main/java/org/onap') diff --git a/src/main/java/org/onap/clamp/clds/Application.java b/src/main/java/org/onap/clamp/clds/Application.java index 0eb480751..749a2f6fa 100644 --- a/src/main/java/org/onap/clamp/clds/Application.java +++ b/src/main/java/org/onap/clamp/clds/Application.java @@ -26,10 +26,13 @@ package org.onap.clamp.clds; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; +import java.io.IOException; + import org.apache.catalina.connector.Connector; import org.onap.clamp.clds.model.properties.Holmes; import org.onap.clamp.clds.model.properties.ModelProperties; import org.onap.clamp.clds.util.ClampVersioning; +import org.onap.clamp.clds.util.ResourceFileUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -64,7 +67,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; @EnableScheduling public class Application extends SpringBootServletInitializer { - protected static final EELFLogger EELF_LOGGER = EELFManager.getInstance().getLogger(Application.class); + protected static final EELFLogger eelfLogger = EELFManager.getInstance().getLogger(Application.class); // This settings is an additional one to Spring config, // only if we want to have an additional port automatically redirected to // HTTPS @@ -85,7 +88,6 @@ public class Application extends SpringBootServletInitializer { } public static void main(String[] args) { - EELF_LOGGER.info("Starting :: CLAMP :: (v"+ ClampVersioning.getCldsVersionFromProps()+")"); // This is to initialize some Onap Clamp components initializeComponents(); // Start the Spring application @@ -100,9 +102,11 @@ public class Application extends SpringBootServletInitializer { * This method is used to declare the camel servlet. * * @return A servlet bean + * @throws IOException */ @Bean - public ServletRegistrationBean camelServletRegistrationBean() { + public ServletRegistrationBean camelServletRegistrationBean() throws IOException { + eelfLogger.info(ResourceFileUtil.getResourceAsString("boot-message.txt")+"(v"+ ClampVersioning.getCldsVersionFromProps()+")"+System.getProperty("line.separator")); ServletRegistrationBean registration = new ServletRegistrationBean(new ClampServlet(), "/restservices/clds/v1/*"); registration.setName("CamelServlet"); @@ -130,7 +134,7 @@ public class Application extends SpringBootServletInitializer { private Connector createRedirectConnector(int redirectSecuredPort) { if (redirectSecuredPort <= 0) { - EELF_LOGGER.warn( + eelfLogger.warn( "HTTP port redirection to HTTPS is disabled because the HTTPS port is 0 (random port) or -1 (Connector disabled)"); return null; } -- cgit 1.2.3-korg