Improve logging

This commit is contained in:
Manfred Karrer 2016-07-26 11:49:12 +02:00
parent 60576049cf
commit 82ce478123
2 changed files with 8 additions and 2 deletions

View File

@ -52,7 +52,10 @@ public class RestartUtil {
try {
final String command = "nohup " + cmd.toString() + " >/dev/null 2>" + logPath + " &";
log.warn("Executing cmd for restart:\n" + command);
log.warn("\n\n############################################################\n" +
"Executing cmd for restart: {}" +
"\n############################################################\n\n",
command);
Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();

View File

@ -94,7 +94,10 @@ public class SeedNodeMain extends BitsquareExecutable {
long usedMemoryInMB = Profiler.getUsedMemoryInMB();
if (!stopped) {
if (usedMemoryInMB > (MAX_MEMORY_MB - 100)) {
log.warn("We are over our memory warn limit and call the GC");
log.warn("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
"We are over our memory warn limit and call the GC. usedMemoryInMB: {}" +
"\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n",
usedMemoryInMB);
System.gc();
usedMemoryInMB = Profiler.getUsedMemoryInMB();
Profiler.printSystemLoad(log);