Browse Source

fix ugly logger usage (#2063)

* fix ugly logger usage

* remove space
pull/2/head
qiaozhanwei 5 years ago committed by GitHub
parent
commit
d5c795bd45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java
  2. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
  3. 2
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/NettyRemotingServer.java
  4. 2
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java
  5. 2
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java
  6. 2
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
  7. 6
      dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataAnalysisController.java

@ -103,7 +103,7 @@ public class DataAnalysisController extends BaseController{
@RequestParam(value="endDate", required=false) String endDate, @RequestParam(value="endDate", required=false) String endDate,
@RequestParam(value="projectId", required=false, defaultValue = "0") int projectId){ @RequestParam(value="projectId", required=false, defaultValue = "0") int projectId){
try{ try{
logger.info("count process instance state, user:{}, start date: {}, end date:{}, project id", logger.info("count process instance state, user:{}, start date: {}, end date:{}, project id:{}",
loginUser.getUserName(), startDate, endDate, projectId); loginUser.getUserName(), startDate, endDate, projectId);
Map<String, Object> result = dataAnalysisService.countProcessInstanceStateByProject(loginUser, projectId, startDate, endDate); Map<String, Object> result = dataAnalysisService.countProcessInstanceStateByProject(loginUser, projectId, startDate, endDate);
return returnDataList(result); return returnDataList(result);
@ -129,7 +129,7 @@ public class DataAnalysisController extends BaseController{
public Result countDefinitionByUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result countDefinitionByUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value="projectId", required=false, defaultValue = "0") int projectId){ @RequestParam(value="projectId", required=false, defaultValue = "0") int projectId){
try{ try{
logger.info("count process definition , user:{}, project id", logger.info("count process definition , user:{}, project id:{}",
loginUser.getUserName(), projectId); loginUser.getUserName(), projectId);
Map<String, Object> result = dataAnalysisService.countDefinitionByUser(loginUser, projectId); Map<String, Object> result = dataAnalysisService.countDefinitionByUser(loginUser, projectId);
return returnDataList(result); return returnDataList(result);

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java

@ -173,7 +173,7 @@ public class ExecutorController extends BaseController {
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
public Result startCheckProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result startCheckProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "processDefinitionId") int processDefinitionId) { @RequestParam(value = "processDefinitionId") int processDefinitionId) {
logger.info("login user {}, check process definition", loginUser.getUserName(), processDefinitionId); logger.info("login user {}, check process definition {}", loginUser.getUserName(), processDefinitionId);
try { try {
Map<String, Object> result = execService.startCheckByProcessDefinedId(processDefinitionId); Map<String, Object> result = execService.startCheckByProcessDefinedId(processDefinitionId);
return returnDataList(result); return returnDataList(result);

2
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/NettyRemotingServer.java

@ -145,7 +145,7 @@ public class NettyRemotingServer {
try { try {
future = serverBootstrap.bind(serverConfig.getListenPort()).sync(); future = serverBootstrap.bind(serverConfig.getListenPort()).sync();
} catch (Exception e) { } catch (Exception e) {
logger.error("NettyRemotingServer bind fail {}, exit", e); logger.error("NettyRemotingServer bind fail {}, exit",e.getMessage(), e);
throw new RuntimeException(String.format("NettyRemotingServer bind %s fail", serverConfig.getListenPort())); throw new RuntimeException(String.format("NettyRemotingServer bind %s fail", serverConfig.getListenPort()));
} }
if (future.isSuccess()) { if (future.isSuccess()) {

2
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java

@ -107,7 +107,7 @@ public class NettyClientHandler extends ChannelInboundHandlerAdapter {
*/ */
@Override @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
logger.error("exceptionCaught : {}", cause); logger.error("exceptionCaught : {}",cause.getMessage(), cause);
nettyRemotingClient.closeChannel(ChannelUtils.toAddress(ctx.channel())); nettyRemotingClient.closeChannel(ChannelUtils.toAddress(ctx.channel()));
ctx.channel().close(); ctx.channel().close();
} }

2
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java

@ -140,7 +140,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
*/ */
@Override @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
logger.error("exceptionCaught : {}", cause); logger.error("exceptionCaught : {}",cause.getMessage(), cause);
ctx.channel().close(); ctx.channel().close();
} }

2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java

@ -565,7 +565,7 @@ public class MasterExecThread implements Runnable {
TaskInstance taskInstance = completeTaskList.get(nodeName); TaskInstance taskInstance = completeTaskList.get(nodeName);
if(taskInstance == null){ if(taskInstance == null){
logger.error("task instance cannot find, please check it!", nodeName); logger.error("task instance {} cannot find, please check it!", nodeName);
return conditionTaskList; return conditionTaskList;
} }

6
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

@ -116,12 +116,12 @@ public class ProcessService {
ProcessInstance processInstance = constructProcessInstance(command, host); ProcessInstance processInstance = constructProcessInstance(command, host);
//cannot construct process instance, return null; //cannot construct process instance, return null;
if(processInstance == null){ if(processInstance == null){
logger.error("scan command, command parameter is error: %s", command.toString()); logger.error("scan command, command parameter is error: {}", command);
moveToErrorCommand(command, "process instance is null"); moveToErrorCommand(command, "process instance is null");
return null; return null;
} }
if(!checkThreadNum(command, validThreadNum)){ if(!checkThreadNum(command, validThreadNum)){
logger.info("there is not enough thread for this command: {}",command.toString() ); logger.info("there is not enough thread for this command: {}", command);
return setWaitingThreadProcess(command, processInstance); return setWaitingThreadProcess(command, processInstance);
} }
processInstance.setCommandType(command.getCommandType()); processInstance.setCommandType(command.getCommandType());
@ -991,7 +991,7 @@ public class ProcessService {
return insertQueueResult; return insertQueueResult;
}catch (Exception e){ }catch (Exception e){
logger.error("submit task to queue Exception: ", e); logger.error("submit task to queue Exception: ", e);
logger.error("task queue error : %s", JSONUtils.toJson(taskInstance)); logger.error("task queue error : {}", JSONUtils.toJson(taskInstance));
return false; return false;
} }
} }

Loading…
Cancel
Save