Appended timestamp to log file names

This commit is contained in:
Kai S. K. Engelbart 2020-02-16 21:53:10 +01:00
parent cd590448cc
commit 7129e82038

View File

@ -2,6 +2,8 @@ package envoy.client.util;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.*; import java.util.logging.*;
import envoy.client.data.Config; import envoy.client.data.Config;
@ -25,7 +27,8 @@ public class EnvoyLog {
LogManager.getLogManager().reset(); LogManager.getLogManager().reset();
// Configure log file // Configure log file
File logFile = new File(Config.getInstance().getHomeDirectory(), "log/envoy_user.log"); File logFile = new File(Config.getInstance().getHomeDirectory(),
"log/envoy_user_" + new SimpleDateFormat("yyyy-MM-dd--hh-mm-mm").format(new Date()) + ".log");
logFile.getParentFile().mkdirs(); logFile.getParentFile().mkdirs();
// Configure formatting // Configure formatting