Skip to content

Commit

Permalink
optimize: log message level (#5212)
Browse files Browse the repository at this point in the history
  • Loading branch information
renliangyu857 authored Dec 29, 2022
1 parent 1bad3b8 commit e423b38
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
3 changes: 1 addition & 2 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ Add changes here for all PR submitted to the develop branch.
- [[#xxx](https://github.com/seata/seata/pull/xxx)] support xxx

### bugfix:
- [[#xxx](https://github.com/seata/seata/pull/xxx)] fix xxx
- [[#5194](https://github.com/seata/seata/pull/5194)] fix wrong keyword order for oracle when creating a table
- [[#5021](https://github.com/seata/seata/pull/5201)] Fix JDK Reflection for Spring origin proxy failed in JDK17

### optimize:
- [[#xxx](https://github.com/seata/seata/pull/xxx)] optimize xxx
- [[#5212](https://github.com/seata/seata/pull/5212)] optimize log message level

### test:
- [[#xxx](https://github.com/seata/seata/pull/xxx)] add test for xxx
Expand Down
2 changes: 1 addition & 1 deletion changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- [[#5021](https://github.com/seata/seata/pull/5201)] 修复 JDK17 下获取 Spring 原始代理对象失败的问题

### optimize:
- [[#xxx](https://github.com/seata/seata/pull/xxx)] 优化 xxx
- [[#5212](https://github.com/seata/seata/pull/5212)] 优化不合理的日志信息级别

### test:
- [[#xxx](https://github.com/seata/seata/pull/xxx)] 增加 xxx 测试
Expand Down
10 changes: 5 additions & 5 deletions console/src/main/java/io/seata/console/utils/JwtTokenUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ public boolean validateToken(String token) {
Jwts.parser().setSigningKey(secretKey).parseClaimsJws(token);
return true;
} catch (SignatureException e) {
LOGGER.info("Invalid JWT signature.");
LOGGER.warn("Invalid JWT signature.");
LOGGER.trace("Invalid JWT signature trace: {}", e);
} catch (MalformedJwtException e) {
LOGGER.info("Invalid JWT token.");
LOGGER.warn("Invalid JWT token.");
LOGGER.trace("Invalid JWT token trace: {}", e);
} catch (ExpiredJwtException e) {
LOGGER.info("Expired JWT token.");
LOGGER.warn("Expired JWT token.");
LOGGER.trace("Expired JWT token trace: {}", e);
} catch (UnsupportedJwtException e) {
LOGGER.info("Unsupported JWT token.");
LOGGER.warn("Unsupported JWT token.");
LOGGER.trace("Unsupported JWT token trace: {}", e);
} catch (IllegalArgumentException e) {
LOGGER.info("JWT token compact of handler are invalid.");
LOGGER.warn("JWT token compact of handler are invalid.");
LOGGER.trace("JWT token compact of handler are invalid trace: {}", e);
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ public <T extends AbstractTransactionRequest, S extends AbstractTransactionRespo
callback.onSuccess(request, response);
} catch (TransactionException tex) {
if (Objects.equals(LockKeyConflict, tex.getCode())) {
LOGGER.info("this request cannot acquire global lock, you can let Seata retry by setting config [{}] = false or manually retry by yourself. request: {}",
LOGGER.error("this request cannot acquire global lock, you can let Seata retry by setting config [{}] = false or manually retry by yourself. request: {}",
ConfigurationKeys.CLIENT_LOCK_RETRY_POLICY_BRANCH_ROLLBACK_ON_CONFLICT, request);
} else if (Objects.equals(LockKeyConflictFailFast, tex.getCode())) {
LOGGER.info("this request cannot acquire global lock, decide fail-fast because LockStatus is {}. request: {}",
LOGGER.error("this request cannot acquire global lock, decide fail-fast because LockStatus is {}. request: {}",
LockStatus.Rollbacking, request);
} else {
LOGGER.error("Catch TransactionException while do RPC, request: {}", request, tex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public BranchStatus branchRollback(BranchType branchType, String xid, long branc
try {
UndoLogManagerFactory.getUndoLogManager(dataSourceProxy.getDbType()).undo(dataSourceProxy, xid, branchId);
} catch (TransactionException te) {
StackTraceLogger.info(LOGGER, te,
StackTraceLogger.error(LOGGER, te,
"branchRollback failed. branchType:[{}], xid:[{}], branchId:[{}], resourceId:[{}], applicationData:[{}]. reason:[{}]",
new Object[]{branchType, xid, branchId, resourceId, applicationData, te.getMessage()});
if (te.getCode() == TransactionExceptionCode.BranchRollbackFailed_Unretriable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void initXaTwoPhaseTimeoutChecker() {
try {
connection.closeForce();
} catch (SQLException e) {
LOGGER.info("Force close the xa physical connection fail", e);
LOGGER.warn("Force close the xa physical connection fail", e);
}
}
}
Expand Down Expand Up @@ -151,11 +151,11 @@ private BranchStatus finishBranch(boolean committed, BranchType branchType, Stri
}
}
if (committed) {
LOGGER.info(xaBranchXid + " commit failed since " + sqle.getMessage(), sqle);
LOGGER.error(xaBranchXid + " commit failed since " + sqle.getMessage(), sqle);
// FIXME: case of PhaseTwo_CommitFailed_Unretryable
return BranchStatus.PhaseTwo_CommitFailed_Retryable;
} else {
LOGGER.info(xaBranchXid + " rollback failed since " + sqle.getMessage(), sqle);
LOGGER.error(xaBranchXid + " rollback failed since " + sqle.getMessage(), sqle);
// FIXME: case of PhaseTwo_RollbackFailed_Unretryable
return BranchStatus.PhaseTwo_RollbackFailed_Retryable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ protected void handleRetryRollbacking() {
rollbackingSession.addSessionLifecycleListener(SessionHolder.getRootSessionManager());
core.doGlobalRollback(rollbackingSession, true);
} catch (TransactionException ex) {
LOGGER.info("Failed to retry rollbacking [{}] {} {}", rollbackingSession.getXid(), ex.getCode(), ex.getMessage());
LOGGER.error("Failed to retry rollbacking [{}] {} {}", rollbackingSession.getXid(), ex.getCode(), ex.getMessage());
}
});
}
Expand Down Expand Up @@ -426,7 +426,7 @@ protected void handleRetryCommitting() {
committingSession.addSessionLifecycleListener(SessionHolder.getRootSessionManager());
core.doGlobalCommit(committingSession, true);
} catch (TransactionException ex) {
LOGGER.info("Failed to retry committing [{}] {} {}", committingSession.getXid(), ex.getCode(), ex.getMessage());
LOGGER.error("Failed to retry committing [{}] {} {}", committingSession.getXid(), ex.getCode(), ex.getMessage());
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ public boolean doGlobalCommit(GlobalSession globalSession, boolean retrying) thr
switch (branchStatus) {
case PhaseTwo_Committed:
SessionHelper.removeBranch(globalSession, branchSession, !retrying);
LOGGER.info("Commit branch transaction successfully, xid = {} branchId = {}", globalSession.getXid(), branchSession.getBranchId());
return CONTINUE;
case PhaseTwo_CommitFailed_Unretryable:
//not at branch
Expand Down Expand Up @@ -325,10 +326,10 @@ public boolean doGlobalRollback(GlobalSession globalSession, boolean retrying) t
return CONTINUE;
case PhaseTwo_RollbackFailed_Unretryable:
SessionHelper.endRollbackFailed(globalSession, retrying);
LOGGER.info("Rollback branch transaction fail and stop retry, xid = {} branchId = {}", globalSession.getXid(), branchSession.getBranchId());
LOGGER.error("Rollback branch transaction fail and stop retry, xid = {} branchId = {}", globalSession.getXid(), branchSession.getBranchId());
return false;
default:
LOGGER.info("Rollback branch transaction fail and will retry, xid = {} branchId = {}", globalSession.getXid(), branchSession.getBranchId());
LOGGER.error("Rollback branch transaction fail and will retry, xid = {} branchId = {}", globalSession.getXid(), branchSession.getBranchId());
if (!retrying) {
globalSession.queueToRetryRollback();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public static boolean distributedLockAndExecute(String key, NoArgsFunc func) {
func.call();
}
} catch (Exception e) {
LOGGER.info("Exception running function with key = {}", key, e);
LOGGER.error("Exception running function with key = {}", key, e);
} finally {
if (lock) {
try {
Expand Down

0 comments on commit e423b38

Please sign in to comment.