[강운덕] [LUCYSUS-1744] 로그가 저장될 위치를 세팅한다.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-profiler-bootstrap/trunk@1547 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2013-04-24 07:30:22 +00:00
parent a2fb135491
commit c852127eec
2 changed files with 14 additions and 3 deletions
@@ -109,6 +109,10 @@ public class ClassPathResolver {
return this.agentDirPath + File.separator + "lib";
}
public String getAgentLogFilePath() {
return this.agentDirPath + File.separator + "log";
}
public List<URL> resolveLib() {
String agentLibPath = getAgentLibPath();
File libDir = new File(agentLibPath);
@@ -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<URL> 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);