Skip to content

Commit

Permalink
#509 log normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
kfchu committed Oct 12, 2018
1 parent 64c8344 commit 4d0ee9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static com.vip.saturn.job.utils.LogEvents.ExecutorEvent.COMMON;

/**
* @author hebelala
*/
Expand Down Expand Up @@ -47,7 +49,7 @@ public void stateChanged(final CuratorFramework client, final ConnectionState ne
final String clientStr = client.toString();
if (ConnectionState.SUSPENDED == newState) {
connected = false;
LogUtils.warn(log, EnhancedConnectionStateListener.class.getCanonicalName(),
LogUtils.warn(log, COMMON,
"The executor {} found zk is SUSPENDED, client is {}", executorName, clientStr);
final long sessionId = getSessionId(client);
if (!closed) {
Expand Down Expand Up @@ -78,7 +80,7 @@ public void run() {
});
}
} else if (ConnectionState.RECONNECTED == newState) {
LogUtils.warn(log, EnhancedConnectionStateListener.class.getCanonicalName(),
LogUtils.warn(log, COMMON,
"The executor {} found zk is RECONNECTED, client is {}", executorName, clientStr);
connected = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

package com.vip.saturn.job.internal.analyse;

import com.vip.saturn.job.utils.LogUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.TreeCacheEvent;
import org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type;
Expand Down Expand Up @@ -52,10 +53,10 @@ protected void dataChanged(CuratorFramework client, TreeCacheEvent event, String
if (JobNodePath.getNodeFullPath(jobName, AnalyseNode.RESET).equals(path)
&& (Type.NODE_UPDATED == event.getType() || Type.NODE_ADDED == event.getType())) {
if (ResetCountType.RESET_ANALYSE.equals(new String(event.getData().getData()))) {
log.info("[{}] msg=job:{} reset anaylse count.", jobName, jobName);
LogUtils.info(log, jobName, "job:{} reset anaylse count.", jobName);
ProcessCountStatistics.resetAnalyseCount(executorName, jobName);
} else if (ResetCountType.RESET_SERVERS.equals(new String(event.getData().getData()))) {
log.info("[{}] msg=job:{} reset success/failure count.", jobName, jobName);
LogUtils.info(log, jobName, "job:{} reset success/failure count", jobName);
ProcessCountStatistics.resetSuccessFailureCount(executorName, jobName);
}
}
Expand Down

0 comments on commit 4d0ee9e

Please sign in to comment.