From eeed2ae14fceb21c9518a0056b2a29039b69f092 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Wed, 13 Jun 2018 17:19:07 -0500 Subject: Adjust Logging Dir settings for ONAP Users Issue-ID: AAF-360 Change-Id: If19090ef482372d3a3a9aa2856762af91bc54017 Signed-off-by: Instrumental --- .../src/main/java/org/onap/aaf/misc/env/log4j/LogFileNamer.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'misc/log4j/src/main') diff --git a/misc/log4j/src/main/java/org/onap/aaf/misc/env/log4j/LogFileNamer.java b/misc/log4j/src/main/java/org/onap/aaf/misc/env/log4j/LogFileNamer.java index a98ba7c0..c6537deb 100644 --- a/misc/log4j/src/main/java/org/onap/aaf/misc/env/log4j/LogFileNamer.java +++ b/misc/log4j/src/main/java/org/onap/aaf/misc/env/log4j/LogFileNamer.java @@ -59,15 +59,14 @@ public class LogFileNamer { * @throws IOException */ public String setAppender(String appender) throws IOException { - String filename; int i = 0; File f; - while ((f = new File(filename = String.format(FILE_FORMAT_STR, dir, root, appender, ending, i))).exists()) { + while ((f = new File(String.format(FILE_FORMAT_STR, dir, root, appender, ending, i))).exists()) { ++i; } - ; + f.createNewFile(); - System.setProperty("LOG4J_FILENAME_" + appender, filename); + System.setProperty("LOG4J_FILENAME_" + appender, f.getCanonicalPath()); return appender; } -- cgit 1.2.3-korg