diff --git a/rasp/jvm/JVMAgent/src/main/java/com/security/smithloader/log/SmithAgentLogger.java b/rasp/jvm/JVMAgent/src/main/java/com/security/smithloader/log/SmithAgentLogger.java index c573d1c5f..cd4c19a9a 100644 --- a/rasp/jvm/JVMAgent/src/main/java/com/security/smithloader/log/SmithAgentLogger.java +++ b/rasp/jvm/JVMAgent/src/main/java/com/security/smithloader/log/SmithAgentLogger.java @@ -1,9 +1,7 @@ package com.security.smithloader.log; -import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import java.time.Instant; import java.util.logging.FileHandler; import java.util.logging.Logger; import java.util.logging.SimpleFormatter; @@ -14,9 +12,8 @@ public class SmithAgentLogger { public static Logger logger = Logger.getLogger("RASPAgent"); static { - logger.setUseParentHandlers(false); - try { + logger.setUseParentHandlers(false); String filename = String.format("/tmp/JVMAgent.%d.log", ProcessHelper.getCurrentPID()); FileHandler handler = new FileHandler(filename, 5 * 1024 * 1024, 5, true); @@ -25,7 +22,7 @@ public class SmithAgentLogger { SimpleFormatter formatter = new SimpleFormatter(); handler.setFormatter(formatter); - } catch (IOException | NumberFormatException e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/rasp/jvm/JVMProbe/src/main/java/com/security/smith/log/AttachInfo.java b/rasp/jvm/JVMProbe/src/main/java/com/security/smith/log/AttachInfo.java index e54bec0bf..452f20312 100644 --- a/rasp/jvm/JVMProbe/src/main/java/com/security/smith/log/AttachInfo.java +++ b/rasp/jvm/JVMProbe/src/main/java/com/security/smith/log/AttachInfo.java @@ -2,7 +2,6 @@ import java.io.File; import java.io.FileWriter; -import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -30,7 +29,7 @@ public static void info() { } } } - } catch (IOException e) { + } catch (Exception e) { System.out.println(e.getMessage()); } } diff --git a/rasp/jvm/JVMProbe/src/main/java/com/security/smith/log/SmithLogger.java b/rasp/jvm/JVMProbe/src/main/java/com/security/smith/log/SmithLogger.java index 31013225a..7bb8afd79 100644 --- a/rasp/jvm/JVMProbe/src/main/java/com/security/smith/log/SmithLogger.java +++ b/rasp/jvm/JVMProbe/src/main/java/com/security/smith/log/SmithLogger.java @@ -2,10 +2,8 @@ import com.security.smith.common.ProcessHelper; -import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import java.time.Instant; import java.util.logging.FileHandler; import java.util.logging.Logger; import java.util.logging.SimpleFormatter; @@ -16,9 +14,9 @@ public class SmithLogger { public static void loggerProberInit() { - logger.setUseParentHandlers(false); - + try { + logger.setUseParentHandlers(false); String filename = String.format("/tmp/JVMProbe.%d.log", ProcessHelper.getCurrentPID()); fileHandler = new FileHandler(filename, 5 * 1024 * 1024, 5, true); @@ -27,7 +25,7 @@ public static void loggerProberInit() { SimpleFormatter formatter = new SimpleFormatter(); fileHandler.setFormatter(formatter); - } catch (IOException | NumberFormatException e) { + } catch (Exception e) { e.printStackTrace(); } }