aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java12
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java4
2 files changed, 15 insertions, 1 deletions
diff --git a/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java b/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
index 2c6fcea9d..e4386c150 100644
--- a/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
+++ b/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
@@ -37,11 +37,16 @@
*/
package org.onap.portalapp.conf;
+import static org.onap.vid.controller.LoggerController.VID_IS_STARTED;
+
import java.util.TimeZone;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
+import org.onap.logging.filter.base.AbstractAuditLogFilter;
+import org.onap.logging.filter.base.AbstractMetricLogFilter;
import org.onap.portalsdk.core.conf.AppInitializer;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.slf4j.LoggerFactory;
public class ExternalAppInitializer extends AppInitializer {
@@ -60,6 +65,13 @@ public class ExternalAppInitializer extends AppInitializer {
super.onStartup(servletContext);
setDefaultTimeZoneToUTC();
setPartnerName();
+ logVidIsStarted();
+ }
+
+ //mark in logs that vid is started.
+ private void logVidIsStarted() {
+ LoggerFactory.getLogger(AbstractMetricLogFilter.class).info(VID_IS_STARTED);
+ LoggerFactory.getLogger(AbstractAuditLogFilter.class).info(VID_IS_STARTED);
}
private void setPartnerName() {
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java b/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java
index 48677120d..7233a67e3 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java
@@ -56,6 +56,7 @@ import org.springframework.web.bind.annotation.RestController;
public class LoggerController extends RestrictedBaseController {
private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(LoggerController.class);
+ public static final String VID_IS_STARTED = "VID is started";
private RoleProvider roleProvider;
private LogfilePathCreator logfilePathCreator;
@@ -90,7 +91,8 @@ public class LoggerController extends RestrictedBaseController {
return Streams.takeWhile(
Stream.generate(reverseLinesSupplier),
- line -> !StringUtils.contains(line, "Logging is started"))
+ line -> !StringUtils.contains(line, "Logging is started") &&
+ !StringUtils.contains(line, VID_IS_STARTED))
.limit(limit)
.limit(5_000)
.filter(Objects::nonNull)