aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-08-09 17:14:09 +0200
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-08-09 17:14:09 +0200
commit499e4e89cb68c99547df5632df358847b62ccc3f (patch)
tree0861fc21c6ef79ff4b711bd3df6e9a16b3ff19d3 /src/main/java
parent22bda27545153fd0b1a8f6609867699b3ee23a75 (diff)
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) <sd378r@intl.att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/clds/Application.java12
1 files changed, 8 insertions, 4 deletions
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;
}