|
|
@@ -1,15 +1,15 @@
|
|
1
|
1
|
package com.xxl.job.core.log;
|
|
2
|
2
|
|
|
3
|
|
-import java.io.PrintWriter;
|
|
4
|
|
-import java.io.StringWriter;
|
|
5
|
|
-import java.text.SimpleDateFormat;
|
|
6
|
|
-import java.util.Date;
|
|
7
|
|
-
|
|
8
|
3
|
import org.slf4j.Logger;
|
|
9
|
4
|
import org.slf4j.LoggerFactory;
|
|
10
|
5
|
import org.slf4j.helpers.FormattingTuple;
|
|
11
|
6
|
import org.slf4j.helpers.MessageFormatter;
|
|
12
|
7
|
|
|
|
8
|
+import java.io.PrintWriter;
|
|
|
9
|
+import java.io.StringWriter;
|
|
|
10
|
+import java.text.SimpleDateFormat;
|
|
|
11
|
+import java.util.Date;
|
|
|
12
|
+
|
|
13
|
13
|
/**
|
|
14
|
14
|
* Created by xuxueli on 17/4/28.
|
|
15
|
15
|
*/
|
|
|
@@ -50,20 +50,20 @@ public class XxlJobLogger {
|
|
50
|
50
|
/**
|
|
51
|
51
|
* append log with pattern
|
|
52
|
52
|
*
|
|
53
|
|
- * @param appendLogPattern like "aaa {0} bbb {1} ccc"
|
|
|
53
|
+ * @param appendLogPattern like "aaa {} bbb {} ccc"
|
|
54
|
54
|
* @param appendLogArguments like "111, true"
|
|
55
|
55
|
*/
|
|
56
|
56
|
public static void log(String appendLogPattern, Object ... appendLogArguments) {
|
|
57
|
57
|
|
|
58
|
58
|
FormattingTuple ft = MessageFormatter.format(appendLogPattern, appendLogArguments);
|
|
59
|
|
-
|
|
60
|
59
|
String appendLog = ft.getMessage();
|
|
|
60
|
+
|
|
|
61
|
+ /*appendLog = appendLogPattern;
|
|
|
62
|
+ if (appendLogArguments!=null && appendLogArguments.length>0) {
|
|
|
63
|
+ appendLog = MessageFormat.format(appendLogPattern, appendLogArguments);
|
|
|
64
|
+ }*/
|
|
|
65
|
+
|
|
61
|
66
|
StackTraceElement callInfo = new Throwable().getStackTrace()[1];
|
|
62
|
|
-
|
|
63
|
|
-// appendLog = appendLogPattern;
|
|
64
|
|
-// if (appendLogArguments!=null && appendLogArguments.length>0) {
|
|
65
|
|
-// appendLog = MessageFormat.format(appendLogPattern, appendLogArguments);
|
|
66
|
|
-// }
|
|
67
|
67
|
logDetail(callInfo, appendLog);
|
|
68
|
68
|
}
|
|
69
|
69
|
|