Logging now works, bug reports can be submitted, and reports will be named according to products affected, and time of submission.
This commit is contained in:
parent
3b69fce342
commit
0424d62c07
@ -14,10 +14,12 @@ import org.bson.Document;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@ -1493,7 +1495,18 @@ public class delegationServices {
|
|||||||
String bugType = Lrequest.get("bugType").toString();
|
String bugType = Lrequest.get("bugType").toString();
|
||||||
String bugDetails = Lrequest.get("bugDetails").toString();
|
String bugDetails = Lrequest.get("bugDetails").toString();
|
||||||
String bugSeverity = Lrequest.get("bugSeverity").toString();
|
String bugSeverity = Lrequest.get("bugSeverity").toString();
|
||||||
String timeCurrent = java.time.LocalTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
String timeCurrent = LocalDateTime.now().toString(); //ISO-8601: yyyy-MM-ddTHH:mm:ss.S
|
||||||
|
try {
|
||||||
|
File myObj = new File(homedir + "/ocs/logs/" + applicationName + timeCurrent +".txt");
|
||||||
|
if (myObj.createNewFile()) {
|
||||||
|
System.out.println("Log File created: " + myObj.getName());
|
||||||
|
} else {
|
||||||
|
System.out.println("Log already exists.");
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("An error occurred.");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
FileWriter writer = new FileWriter(homedir + "/ocs/logs/" + applicationName + timeCurrent +".txt", true);
|
FileWriter writer = new FileWriter(homedir + "/ocs/logs/" + applicationName + timeCurrent +".txt", true);
|
||||||
writer.write("This bug report is for: " + applicationName);
|
writer.write("This bug report is for: " + applicationName);
|
||||||
writer.write("\r\n");
|
writer.write("\r\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user