less verbose logging
Update logging level to be less verbose when run in production which will ease the number of writes to disk. Change-Id: I8d873cf103e395f3ed1b41415c946dd6990ba9e0 Closes-Bug: #1290273
This commit is contained in:
parent
b879f56ef1
commit
cb3b3b6fb9
|
@ -109,7 +109,7 @@ public abstract class AbstractWorkerThread implements Runnable {
|
|||
*/
|
||||
public void registerJobs() {
|
||||
|
||||
logger.info("---- AbstractorWorker registerJobs function ----");
|
||||
logger.debug("---- AbstractorWorker registerJobs function ----");
|
||||
|
||||
}
|
||||
|
||||
|
@ -133,8 +133,8 @@ public abstract class AbstractWorkerThread implements Runnable {
|
|||
public void stop() {
|
||||
|
||||
logger.info("---- " + getName() + " Request to stop AWT: " + this);
|
||||
logger.info("---- " + getName() + " Thread: " + thread + " name: " + thread.getName());
|
||||
logger.info("---- " + getName() + " Worker: " + worker);
|
||||
logger.debug("---- " + getName() + " Thread: " + thread + " name: " + thread.getName());
|
||||
logger.debug("---- " + getName() + " Worker: " + worker);
|
||||
synchronized(this) {
|
||||
running = false;
|
||||
if (worker != null) {
|
||||
|
@ -142,11 +142,11 @@ public abstract class AbstractWorkerThread implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
logger.info("---- " + getName() + " Interrupting worker");
|
||||
logger.debug("---- " + getName() + " Interrupting worker");
|
||||
// Interrupt the thread so it unblocks any blocking call
|
||||
thread.interrupt();
|
||||
|
||||
logger.info("---- " + getName() + " Stop request done");
|
||||
logger.debug("---- " + getName() + " Stop request done");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ComputerListenerImpl extends ComputerListener {
|
|||
public void onConfigurationChange() {
|
||||
// only fired on nodes configuration changes like a label or
|
||||
// name change. Not fired on state changes, like offline or online.
|
||||
logger.info("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
logger.debug("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
+ " onConfigurationChange");
|
||||
|
||||
// update functions only when gearman-plugin is enabled
|
||||
|
@ -61,7 +61,7 @@ public class ComputerListenerImpl extends ComputerListener {
|
|||
public void onOffline(Computer c) {
|
||||
// gets called when existing slave dis-connects
|
||||
// gets called when slave is deleted.
|
||||
logger.info("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
logger.debug("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
+ " onOffline computer" + c);
|
||||
|
||||
// update functions only when gearman-plugin is enabled
|
||||
|
@ -79,7 +79,7 @@ public class ComputerListenerImpl extends ComputerListener {
|
|||
// gets called when master goes into online state
|
||||
// gets called when existing slave re-connects
|
||||
// gets called when new slave goes into online state
|
||||
logger.info("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
logger.debug("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
+ " onOnline computer " + c);
|
||||
|
||||
// update functions only when gearman-plugin is enabled
|
||||
|
@ -102,7 +102,7 @@ public class ComputerListenerImpl extends ComputerListener {
|
|||
@Override
|
||||
public void onTemporarilyOffline(Computer c, OfflineCause cause) {
|
||||
// fired when master or slave goes into temporary offline state
|
||||
logger.info("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
logger.debug("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
+ " onTemporarilyOffline computer " + c);
|
||||
// update functions only when gearman-plugin is enabled
|
||||
if (!GearmanPluginConfig.get().enablePlugin()) {
|
||||
|
@ -116,7 +116,7 @@ public class ComputerListenerImpl extends ComputerListener {
|
|||
@Override
|
||||
public void onTemporarilyOnline(Computer c) {
|
||||
// fired when master or slave goes into temporary online state
|
||||
logger.info("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
logger.debug("---- " + ComputerListenerImpl.class.getName() + ":"
|
||||
+ " onTemporarilyOnline computer " + c);
|
||||
// update functions only when gearman-plugin is enabled
|
||||
if (!GearmanPluginConfig.get().enablePlugin()) {
|
||||
|
|
|
@ -194,17 +194,17 @@ public class GearmanPluginConfig extends GlobalConfiguration {
|
|||
} else {
|
||||
try {
|
||||
socket.connect(endPoint, timeout);
|
||||
logger.info("Connection Success: " + endPoint);
|
||||
logger.debug("Connection Success: " + endPoint);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
logger.info("Connection Failure: " + endPoint + " message: "
|
||||
logger.warn("Connection Failure: " + endPoint + " message: "
|
||||
+ e.getClass().getSimpleName() + " - " + e.getMessage());
|
||||
} finally {
|
||||
if (socket != null) {
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception e) {
|
||||
logger.info(e.getMessage());
|
||||
logger.warn(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ public class GearmanProxy {
|
|||
} catch (NullPointerException npe) {
|
||||
logger.info("---- Master is offline");
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception while finding master", e);
|
||||
logger.warn("Exception while finding master", e);
|
||||
}
|
||||
|
||||
if (masterNode != null) {
|
||||
|
@ -147,7 +147,7 @@ public class GearmanProxy {
|
|||
}
|
||||
}
|
||||
|
||||
logger.info("---- Num of executors running = " + getNumExecutors());
|
||||
logger.debug("---- Num of executors running = " + getNumExecutors());
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -171,7 +171,7 @@ public class GearmanProxy {
|
|||
gwt.start();
|
||||
}
|
||||
|
||||
logger.info("---- Num of executors running = " + getNumExecutors());
|
||||
logger.debug("---- Num of executors running = " + getNumExecutors());
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -183,7 +183,7 @@ public class GearmanProxy {
|
|||
synchronized(gewtHandles) {
|
||||
for (ExecutorWorkerThread t : gewtHandles) {
|
||||
if (t.getComputer() == computer) {
|
||||
logger.info("---- Executor thread already running for " + computer.getName());
|
||||
logger.debug("---- Executor thread already running for " + computer.getName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ public class GearmanProxy {
|
|||
}
|
||||
}
|
||||
|
||||
logger.info("---- Num of executors running = " + getNumExecutors());
|
||||
logger.debug("---- Num of executors running = " + getNumExecutors());
|
||||
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,7 @@ public class GearmanProxy {
|
|||
wt.stop();
|
||||
}
|
||||
|
||||
logger.info("---- Num of executors running = " + getNumExecutors());
|
||||
logger.debug("---- Num of executors running = " + getNumExecutors());
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -270,7 +270,7 @@ public class GearmanProxy {
|
|||
t.stop();
|
||||
}
|
||||
|
||||
logger.info("---- Num of executors running = " + getNumExecutors());
|
||||
logger.debug("---- Num of executors running = " + getNumExecutors());
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -152,7 +152,7 @@ public class MyGearmanWorkerImpl implements GearmanSessionEventHandler {
|
|||
}
|
||||
|
||||
public void reconnect() {
|
||||
LOG.info("---- Worker " + this + " starting reconnect for " + session.toString());
|
||||
LOG.debug("---- Worker " + this + " starting reconnect for " + session.toString());
|
||||
// In case we held the availability lock earlier, release it.
|
||||
availability.unlock(this);
|
||||
try {
|
||||
|
@ -177,7 +177,7 @@ public class MyGearmanWorkerImpl implements GearmanSessionEventHandler {
|
|||
return;
|
||||
}
|
||||
}
|
||||
LOG.info("---- Worker " + this + " ending reconnect for " + session.toString());
|
||||
LOG.debug("---- Worker " + this + " ending reconnect for " + session.toString());
|
||||
}
|
||||
|
||||
public MyGearmanWorkerImpl(AvailabilityMonitor availability) {
|
||||
|
@ -207,7 +207,7 @@ public class MyGearmanWorkerImpl implements GearmanSessionEventHandler {
|
|||
}
|
||||
|
||||
public void setFunctions(Set<GearmanFunctionFactory> functions) {
|
||||
LOG.info("---- Worker " + this + " registering " + functions.size() + " functions");
|
||||
LOG.debug("---- Worker " + this + " registering " + functions.size() + " functions");
|
||||
functionRegistry.setFunctions(functions);
|
||||
ioAvailable.wakeup();
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ public class MyGearmanWorkerImpl implements GearmanSessionEventHandler {
|
|||
public void work() {
|
||||
GearmanSessionEvent event = null;
|
||||
GearmanFunction function = null;
|
||||
LOG.info("---- Worker " + this + " starting work");
|
||||
LOG.debug("---- Worker " + this + " starting work");
|
||||
|
||||
if (!state.equals(State.IDLE)) {
|
||||
throw new IllegalStateException("Can not call work while worker " +
|
||||
|
@ -359,7 +359,7 @@ public class MyGearmanWorkerImpl implements GearmanSessionEventHandler {
|
|||
// For the time being we will execute the jobs synchronously
|
||||
// in the future, I expect to change this.
|
||||
if (function != null) {
|
||||
LOG.info("---- Worker " + this + " executing function");
|
||||
LOG.debug("---- Worker " + this + " executing function");
|
||||
submitFunction(function);
|
||||
// Send another grab_job on the next loop
|
||||
enqueueNoopEvent();
|
||||
|
@ -444,11 +444,11 @@ public class MyGearmanWorkerImpl implements GearmanSessionEventHandler {
|
|||
switch (t) {
|
||||
case JOB_ASSIGN:
|
||||
//TODO Figure out what the right behavior is if JobUUIDRequired was false when we submitted but is now true
|
||||
LOG.info("---- Worker " + this + " received job assignment");
|
||||
LOG.debug("---- Worker " + this + " received job assignment");
|
||||
return addNewJob(event);
|
||||
case JOB_ASSIGN_UNIQ:
|
||||
//TODO Figure out what the right behavior is if JobUUIDRequired was true when we submitted but is now false
|
||||
LOG.info("---- Worker " + this + " received unique job assignment");
|
||||
LOG.debug("---- Worker " + this + " received unique job assignment");
|
||||
return addNewJob(event);
|
||||
case NOOP:
|
||||
LOG.debug("---- Worker " + this + " sending grab job after wakeup");
|
||||
|
@ -504,7 +504,7 @@ public class MyGearmanWorkerImpl implements GearmanSessionEventHandler {
|
|||
|
||||
reconnect();
|
||||
|
||||
LOG.debug("---- Worker " + this + " added server " + conn);
|
||||
LOG.info("---- Worker " + this + " added server " + conn);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -590,7 +590,7 @@ public class MyGearmanWorkerImpl implements GearmanSessionEventHandler {
|
|||
LOG.warn("---- Worker " + this + " encountered IOException while closing selector: ", ioe);
|
||||
}
|
||||
state = State.IDLE;
|
||||
LOG.info("---- Worker " + this + " completed shutdown");
|
||||
LOG.debug("---- Worker " + this + " completed shutdown");
|
||||
|
||||
return exceptions;
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ public class StartJobWorker extends AbstractGearmanFunction {
|
|||
logger.error("---- Worker " + this.worker + " has no " +
|
||||
"computer while trying to take node offline.");
|
||||
} else {
|
||||
logger.info("---- Worker " + this.worker + " setting " +
|
||||
logger.debug("---- Worker " + this.worker + " setting " +
|
||||
"node offline.");
|
||||
computer.setTemporarilyOffline(true,
|
||||
new OfflineCause.ByCLI("Offline due to Gearman request"));
|
||||
|
|
|
@ -84,12 +84,12 @@ public class StopJobWorker extends AbstractGearmanFunction {
|
|||
// abort the running jenkins build
|
||||
if (!executor.isInterrupted()) {
|
||||
executor.interrupt();
|
||||
logger.info("---- Aborting build : " +
|
||||
logger.debug("---- Aborting build : " +
|
||||
jobName + ": " + buildNumber);
|
||||
jobResult = true;
|
||||
}
|
||||
} else {
|
||||
logger.info("---- Request to abourt non-building build : " +
|
||||
logger.debug("---- Request to abort non-building build : " +
|
||||
jobName + ": " + buildNumber);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue