From 34993f43a1cc4504cad15bbd70b6365e5206ea6e Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Sun, 15 Sep 2019 12:08:51 +0300 Subject: Verify audit logs format `audit2019` Issue-ID: VID-253 Change-Id: Ic62c455c101311dc3ac3022912390209e3fd86e7 Signed-off-by: Ittay Stern --- .../src/main/java/org/onap/vid/controller/LoggerController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vid-app-common/src/main/java') 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 b7ff82afe..928e19357 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 @@ -20,6 +20,8 @@ package org.onap.vid.controller; +import static java.nio.charset.StandardCharsets.UTF_8; + import java.io.File; import java.io.IOException; import java.util.List; @@ -63,7 +65,7 @@ public class LoggerController extends RestrictedBaseController { this.logfilePathCreator = logfilePathCreator; } - @GetMapping(value = "/{loggerName:audit|error|metrics}") + @GetMapping(value = "/{loggerName:audit|audit2019|error|metrics}") public String getLog(@PathVariable String loggerName, HttpServletRequest request, @RequestParam(value="limit", defaultValue = "5000") Integer limit) throws IOException { @@ -74,7 +76,7 @@ public class LoggerController extends RestrictedBaseController { } String logfilePath = logfilePathCreator.getLogfilePath(loggerName); - try (final ReversedLinesFileReader reader = new ReversedLinesFileReader(new File(logfilePath))) { + try (final ReversedLinesFileReader reader = new ReversedLinesFileReader(new File(logfilePath), UTF_8)) { Supplier reverseLinesSupplier = () -> { try { return reader.readLine(); -- cgit 1.2.3-korg