Commit 7a750557 authored by Andre Freyssinet's avatar Andre Freyssinet

Logging enhancements.

parent b3ed858d
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2016 - 2017 ScalAgent Distributed Technologies
* Copyright (C) 2016 - 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
......@@ -85,11 +85,12 @@ public class Activator implements BundleActivator {
if (value != null && !value.isEmpty()) {
try {
period = Integer.parseInt(value);
logger.log(BasicLevel.INFO,
"Set configuration property " + Helper.BUNDLE_CLEANER_PERIOD_PROP + " to " + value);
} catch (NumberFormatException exc) {
if (logger.isLoggable(BasicLevel.WARN))
logger.log(BasicLevel.WARN,
"Bad configuration property " + Helper.BUNDLE_CLEANER_PERIOD_PROP + ", should be a number: " + value, exc);
}
"Bad configuration property " + Helper.BUNDLE_CLEANER_PERIOD_PROP + ", should be a number: " + value);
}
}
if (period > 0) {
cleanerTask = new CleanerTask();
......
......@@ -146,10 +146,11 @@ public class Helper {
if (value != null && !value.isEmpty()) {
try {
globalIdleTimeout = Long.parseLong(value);
logger.log(BasicLevel.INFO,
"Set configuration property " + BUNDLE_IDLE_TIMEOUT_PROP + " to " + value);
} catch (NumberFormatException exc) {
if (logger.isLoggable(BasicLevel.WARN))
logger.log(BasicLevel.WARN,
"Bad configuration property " + BUNDLE_IDLE_TIMEOUT_PROP + ", should be a number: " + value, exc);
"Bad configuration property " + BUNDLE_IDLE_TIMEOUT_PROP + ", should be a number: " + value);
}
}
}
......@@ -346,7 +347,7 @@ public class Helper {
else
jmsContext = restClientCtx.getConnectionFactory().createContext();
jmsContext.setClientID(restClientCtx.getClientId());
jmsContext.setAutoStart(false);//the defaul is true.
jmsContext.setAutoStart(false);//the default is true.
restClientCtx.setJmsContext(jmsContext);
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "Helper.createProducer jmsContext = " + restClientCtx.getJmsContext());
......
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