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 BULL
* Copyright (C) 1996 - 2000 INRIA * Copyright (C) 1996 - 2000 INRIA
* *
...@@ -422,8 +422,7 @@ public abstract class Agent implements AgentMBean, Serializable, Encodable { ...@@ -422,8 +422,7 @@ public abstract class Agent implements AgentMBean, Serializable, Encodable {
try { try {
id = new AgentId(to); id = new AgentId(to);
} catch (IOException exc) { } catch (IOException exc) {
logmon = Debug.getLogger(fr.dyade.aaa.agent.Debug.A3Agent + logmon = Debug.getLogger(fr.dyade.aaa.agent.Debug.A3Agent + ".#" + AgentServer.getServerId());
".#" + AgentServer.getServerId());
logmon.log(BasicLevel.ERROR, logmon.log(BasicLevel.ERROR,
AgentServer.getName() + ", can't allocate new AgentId", exc); AgentServer.getName() + ", can't allocate new AgentId", exc);
// TODO: throw an exception... // TODO: throw an exception...
...@@ -627,8 +626,13 @@ public abstract class Agent implements AgentMBean, Serializable, Encodable { ...@@ -627,8 +626,13 @@ public abstract class Agent implements AgentMBean, Serializable, Encodable {
try { try {
MXWrapper.registerMBean(this, "AgentServer", getMBeanName()); MXWrapper.registerMBean(this, "AgentServer", getMBeanName());
} catch (Exception exc) { } catch (Exception exc) {
logmon.log(BasicLevel.WARN, if (logmon.isLoggable(BasicLevel.DEBUG)) {
"Agent" + id + " [" + name + "] jmx failed", exc); logmon.log(BasicLevel.WARN,
"Agent" + id + " [" + name + "]: JMX registration failed", exc);
} else {
logmon.log(BasicLevel.WARN,
"Agent" + id + " [" + name + "]: JMX registration failed");
}
} }
if (logmon.isLoggable(BasicLevel.DEBUG)) if (logmon.isLoggable(BasicLevel.DEBUG))
......
/* /*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging * 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 * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -324,7 +324,11 @@ public class ContextManager ...@@ -324,7 +324,11 @@ public class ContextManager
try { try {
MXWrapper.registerMBean(context, "JNDI", "nc=/"+cn); MXWrapper.registerMBean(context, "JNDI", "nc=/"+cn);
} catch (Exception exc) { } 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