Commit 5dbf5e20 authored by Andre Freyssinet's avatar Andre Freyssinet

Logging enhancments.

parent 7bdfadc3
/*
* Copyright (C) 2001 - 2012 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 BULL
* Copyright (C) 1996 - 2000 INRIA
*
......@@ -422,8 +422,7 @@ public abstract class Agent implements AgentMBean, Serializable, Encodable {
try {
id = new AgentId(to);
} catch (IOException exc) {
logmon = Debug.getLogger(fr.dyade.aaa.agent.Debug.A3Agent +
".#" + AgentServer.getServerId());
logmon = Debug.getLogger(fr.dyade.aaa.agent.Debug.A3Agent + ".#" + AgentServer.getServerId());
logmon.log(BasicLevel.ERROR,
AgentServer.getName() + ", can't allocate new AgentId", exc);
// TODO: throw an exception...
......@@ -627,8 +626,13 @@ public abstract class Agent implements AgentMBean, Serializable, Encodable {
try {
MXWrapper.registerMBean(this, "AgentServer", getMBeanName());
} catch (Exception exc) {
if (logmon.isLoggable(BasicLevel.DEBUG)) {
logmon.log(BasicLevel.WARN,
"Agent" + id + " [" + name + "] jmx failed", exc);
"Agent" + id + " [" + name + "]: JMX registration failed", exc);
} else {
logmon.log(BasicLevel.WARN,
"Agent" + id + " [" + name + "]: JMX registration failed");
}
}
if (logmon.isLoggable(BasicLevel.DEBUG))
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2012 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2019 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
......@@ -324,7 +324,11 @@ public class ContextManager
try {
MXWrapper.registerMBean(context, "JNDI", "nc=/"+cn);
} catch (Exception exc) {
Trace.logger.log(BasicLevel.WARN, context + " jmx failed", exc);
if (Trace.logger.isLoggable(BasicLevel.DEBUG)) {
Trace.logger.log(BasicLevel.WARN, context + ": JMX registration failed", exc);
} else {
Trace.logger.log(BasicLevel.WARN, context + ": JMX registration failed");
}
}
}
......
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