Commit f86b08f5 authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Logging enhancements, avoid stacktrace in WARN level.

parent 67817f47
......@@ -135,8 +135,10 @@ public class DistributionDaemon extends Daemon {
AgentServer.getTransaction().begin();
AgentServer.getTransaction().commit(true);
} catch (Exception e) {
if (logger.isLoggable(BasicLevel.WARN))
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.WARN, "DistributionDaemon run()", e);
else
logger.log(BasicLevel.WARN, "DistributionDaemon run(): " + e.getMessage());
if (e instanceof EmptyQueueException) {
continue;
......
......@@ -251,8 +251,10 @@ public class DistributionQueue extends Queue {
nbMsgsDeliverSinceCreation++;
ite.remove();
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.WARN))
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.WARN, "DistributionQueue.preProcess: distribution error.", exc);
else
logger.log(BasicLevel.WARN, "DistributionQueue.preProcess: distribution error - " + exc.getMessage());
// if we don't do batch distribution, stop on first error
if (!batchDistribution)
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2010 - 2017 ScalAgent Distributed Technologies
* Copyright (C) 2010 - 2020 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -151,10 +151,6 @@ public class DistributionTopic extends Topic {
}
}
/**
* @see DistributionModule#processMessages(ClientMessages)
* @see Destination#preProcess(AgentId, ClientMessages)
*/
public ClientMessages preProcess(AgentId from, ClientMessages cm) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "DistributionTopic. preProcess(" + from + ", " + cm + ')');
......@@ -178,8 +174,10 @@ public class DistributionTopic extends Topic {
nbMsgsDeliverSinceCreation++;
}
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.ERROR))
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.ERROR, "DistributionTopic: error during distribution.", exc);
else
logger.log(BasicLevel.ERROR, "DistributionTopic: error during distribution - " + exc.getMessage());
if (dmqManager == null)
dmqManager = new DMQManager(cm.getDMQId(), getDMQAgentId(), getId());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment