From c852127eec41dcabcb083d3067cd4fffa6e774de Mon Sep 17 00:00:00 2001 From: Woonduk Kang Date: Wed, 24 Apr 2013 07:30:22 +0000 Subject: [PATCH] =?UTF-8?q?[=EA=B0=95=EC=9A=B4=EB=8D=95]=20[LUCYSUS-1744]?= =?UTF-8?q?=20=EB=A1=9C=EA=B7=B8=EA=B0=80=20=EC=A0=80=EC=9E=A5=EB=90=A0=20?= =?UTF-8?q?=EC=9C=84=EC=B9=98=EB=A5=BC=20=EC=84=B8=ED=8C=85=ED=95=9C?= =?UTF-8?q?=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-profiler-bootstrap/trunk@1547 84d0f5b1-2673-498c-a247-62c4ff18d310 --- .../com/profiler/bootstrap/ClassPathResolver.java | 4 ++++ .../com/profiler/bootstrap/TomcatBootStrap.java | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/profiler/bootstrap/ClassPathResolver.java b/src/main/java/com/profiler/bootstrap/ClassPathResolver.java index 46e1b0ce9..2c6d67aa6 100644 --- a/src/main/java/com/profiler/bootstrap/ClassPathResolver.java +++ b/src/main/java/com/profiler/bootstrap/ClassPathResolver.java @@ -109,6 +109,10 @@ public class ClassPathResolver { return this.agentDirPath + File.separator + "lib"; } + public String getAgentLogFilePath() { + return this.agentDirPath + File.separator + "log"; + } + public List resolveLib() { String agentLibPath = getAgentLibPath(); File libDir = new File(agentLibPath); diff --git a/src/main/java/com/profiler/bootstrap/TomcatBootStrap.java b/src/main/java/com/profiler/bootstrap/TomcatBootStrap.java index 4f6b62871..adb409140 100644 --- a/src/main/java/com/profiler/bootstrap/TomcatBootStrap.java +++ b/src/main/java/com/profiler/bootstrap/TomcatBootStrap.java @@ -38,16 +38,16 @@ public class TomcatBootStrap { // 설정파일을 못찾으므로 종료. return; } + // 로그가 저장될 위치를 시스템 properties로 저장한다. + saveLogFilePath(classPathResolver); - // 이게 로드할 lib List임. - try { // 설정파일 로드 이게 bootstrap에 있어야 되나는게 맞나? ProfilerConfig profilerConfig = new ProfilerConfig(); profilerConfig.readConfigFile(configPath); - + // 이게 로드할 lib List임. List libUrlList = resolveLib(classPathResolver); AgentClassLoader agentClassLoader = new AgentClassLoader(libUrlList.toArray(new URL[libUrlList.size()])); agentClassLoader.setBootClass("com.profiler.DefaultAgent"); @@ -59,6 +59,13 @@ public class TomcatBootStrap { } + private static void saveLogFilePath(ClassPathResolver classPathResolver) { + String agentLogFilePath = classPathResolver.getAgentLogFilePath(); + logger.info("logPath:" + agentLogFilePath); + + System.setProperty(ProductInfo.NAME + "." + "log", agentLogFilePath); + } + private static String getConfigPath(ClassPathResolver classPathResolver) { final String configName = ProductInfo.NAME + ".config"; String hippoConfigFormSystemProperty = System.getProperty(configName);