diff --git a/config.properties b/config.properties index 0710b84..5084357 100644 --- a/config.properties +++ b/config.properties @@ -1,6 +1,6 @@ # 应用配置 # 调试模式 (true/false) -debug=false +debug=true # 地址列表 (格式: addX=ip:port) addr1=172.1.41.129:8889 diff --git a/src/main/java/com/sunyard/sge/log/LogFactory.java b/src/main/java/com/sunyard/sge/log/LogFactory.java index 72172fa..3731849 100644 --- a/src/main/java/com/sunyard/sge/log/LogFactory.java +++ b/src/main/java/com/sunyard/sge/log/LogFactory.java @@ -62,7 +62,7 @@ public class LogFactory { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); // 日志打印方式——输出为文件    Appender appender = FileAppender.createAppender( - String.format( pcLogPath +"sydapi_"+ format.format(new Date()) + ".log"), + String.format( pcLogPath + "sydapi_"+ format.format(new Date()) + ".log"), "true", "false", logName, null, "true", "true", null, layout, null, null, null, config); @@ -96,6 +96,13 @@ public class LogFactory { * @return Logger */ public static Logger createLogger(String pcLogPath, int iLogLevel) { + if( null == pcLogPath || pcLogPath.trim().equals("") ) { + pcLogPath = "./"; + } + if( ! pcLogPath.endsWith("/") ) { + pcLogPath = pcLogPath + "/"; + } + LogFactory.pcLogPath = pcLogPath; LogFactory.iLogLevel = iLogLevel; start(); diff --git a/src/test/java/test/TestAll.java b/src/test/java/test/TestAll.java index 56a59ae..f7c67cc 100644 --- a/src/test/java/test/TestAll.java +++ b/src/test/java/test/TestAll.java @@ -111,12 +111,14 @@ public class TestAll { switch (choise.getAsInt()) { case 1: + SydApi.SYD_SetLogConfig("./logs", 3); funcMenu(config, choise, test); break; case 2: test.funcAll(); break; case 3: + SydApi.SYD_SetLogConfig("./logs", 0); perfMenu(config, choise, test); break; case 4: @@ -1212,7 +1214,7 @@ public class TestAll { public static void funcMenu(Config config, Choise choise, TestAll test) throws Exception{ boolean flag = true; - + SydApi.SYD_SetLogConfig("./logs", 3); while (flag) { System.out.println("请选择测试项:"); System.out.println("1. 日志测试"); @@ -1397,4 +1399,10 @@ public class TestAll { menu1(config, choise, test); } + + void testComm(){ + String hex = "0436000000000000000E453030383130534B303030303030303030303030303030303030413030303030303030303031303030303234303000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + + } + } diff --git a/test-log4j/jars/sydapi4j.jar b/test-log4j/jars/sydapi4j.jar index c5c7860..bca0b6f 100644 Binary files a/test-log4j/jars/sydapi4j.jar and b/test-log4j/jars/sydapi4j.jar differ