Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3c215422
authored
Jun 24, 2018
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
自研Log组件参数占位符改为"{}",并修复打印有参日志时参数不匹配导致报错的问题;
parent
eb850d76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
doc/XXL-JOB官方文档.md
xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobLogger.java
doc/XXL-JOB官方文档.md
View file @
3c215422
## 《分
布式任务调度平台XXL-JOB》
## 《分
布式任务调度平台XXL-JOB》
...
...
@@ -1222,6 +1222,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
13、任务线程停止变量修饰符优化;
-
14、脚本任务Log文件流关闭优化;
-
15、任务报表成功、失败和进行中统计问题修复;
-
16、自研Log组件参数占位符改为"{}",并修复打印有参日志时参数不匹配导致报错的问题;
### TODO LIST
...
...
xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobLogger.java
View file @
3c215422
package
com
.
xxl
.
job
.
core
.
log
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.helpers.FormattingTuple
;
import
org.slf4j.helpers.MessageFormatter
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* Created by xuxueli on 17/4/28.
*/
...
...
@@ -50,20 +50,20 @@ public class XxlJobLogger {
/**
* append log with pattern
*
* @param appendLogPattern like "aaa {
0} bbb {1
} ccc"
* @param appendLogPattern like "aaa {
} bbb {
} ccc"
* @param appendLogArguments like "111, true"
*/
public
static
void
log
(
String
appendLogPattern
,
Object
...
appendLogArguments
)
{
FormattingTuple
ft
=
MessageFormatter
.
format
(
appendLogPattern
,
appendLogArguments
);
String
appendLog
=
ft
.
getMessage
();
/*appendLog = appendLogPattern;
if (appendLogArguments!=null && appendLogArguments.length>0) {
appendLog = MessageFormat.format(appendLogPattern, appendLogArguments);
}*/
StackTraceElement
callInfo
=
new
Throwable
().
getStackTrace
()[
1
];
// appendLog = appendLogPattern;
// if (appendLogArguments!=null && appendLogArguments.length>0) {
// appendLog = MessageFormat.format(appendLogPattern, appendLogArguments);
// }
logDetail
(
callInfo
,
appendLog
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment