summaryrefslogtreecommitdiffstats
path: root/misc/log4j/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'misc/log4j/src/main/java')
-rw-r--r--misc/log4j/src/main/java/org/onap/aaf/misc/env/log4j/LogFileNamer.java7
1 files changed, 3 insertions, 4 deletions
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;
}