public class AgentLogger extends AbstractAgentLogger
2) this may prove crucial for your debugging to have own logger for planner and another for emotions of your agents, etc.
Simply - every Agent instance (starting with the first abstract class AbstractAgent) has instance of this class (which is java.logging.Logger(s) wrapper).
Every agent's component has own LogCategory and you may obtain your own via getCategory() method.
LogCategory serves as a gateway for your log messages, it contains methods as you
know them from java.logging API (things like fine(), info(), severe(), log(Level, msg), etc.).
Plus it allows you to obtain new LogHandler instances for that category (if you need to
publish log messages from that category somewhere else).
Every LogHandler serves for filtering messages for one category and publishing them
into one end (console, file, memory, whatever...).
Additionally every LogCategory has AgentLogger as its parent.
agentId, LOG_CATEGORY_NAME| Constructor and Description |
|---|
AgentLogger(IAgentId agentId) |
| Modifier and Type | Method and Description |
|---|---|
void |
enableJMX(MBeanServer mBeanServer,
ObjectName parent)
Method for starting the JMX extension of the class.
|
static ObjectName |
getJMXAgentLoggerName(ObjectName parent) |
protected ILogCategories |
getLogCategories() |
addDefaultConsoleHandler, addDefaultFileHandler, addDefaultHandler, addDefaultNetworkHandler, addDefaultPublisher, addToAllCategories, addToAllCategories, getAgentId, getCategories, getCategory, getCategory, getDefaultConsoleHandler, getDefaultNetworkHandler, getNetworkLoggerHost, getNetworkLoggerPort, isDefaultConsoleHandler, isDefaultNetworkHandler, removeDefaultConsoleHandler, removeDefaultHandler, removeDefaultNetworkHandler, removeFromAllCategories, setLevel@Inject public AgentLogger(IAgentId agentId)
public static ObjectName getJMXAgentLoggerName(ObjectName parent)
public void enableJMX(MBeanServer mBeanServer, ObjectName parent) throws JMXAlreadyEnabledException, CantStartJMXException
IJMXEnabledObject should register whatever objects it wants to expose via JMX.
mBeanServer - server where the MBean of agent is registeredparent - parent's ObjectName, should be used as base of name of
the registered MBeanJMXAlreadyEnabledExceptionCantStartJMXExceptionprotected ILogCategories getLogCategories()
getLogCategories in class AbstractAgentLoggerCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.