diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-05-18 14:44:20 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-05-18 14:44:20 +0000 |
| commit | 822e95fa4d350a2916d8b45160df37160c540560 (patch) | |
| tree | b42ce9b7ba8960f745e7ca7ea8ac0a9be81b071a /qpid/java | |
| parent | 7d355716929f49d89ff69dbd9cb24af35b139b6b (diff) | |
| download | qpid-python-822e95fa4d350a2916d8b45160df37160c540560.tar.gz | |
QPID-2584 : Add Logging Actor to HouseKeepingTasks
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@945682 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java index 1f4dd56eb1..45d4be9340 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/HouseKeepingTask.java @@ -21,6 +21,9 @@ package org.apache.qpid.server.virtualhost; import org.apache.log4j.Logger; +import org.apache.qpid.server.logging.RootMessageLogger; +import org.apache.qpid.server.logging.actors.AbstractActor; +import org.apache.qpid.server.logging.actors.CurrentActor; public abstract class HouseKeepingTask implements Runnable { @@ -30,10 +33,12 @@ public abstract class HouseKeepingTask implements Runnable private String _name; + private RootMessageLogger _rootLogger; public HouseKeepingTask(VirtualHost vhost) { _virtualhost = vhost; _name = _virtualhost.getName() + ":" + this.getClass().getSimpleName(); + _rootLogger = CurrentActor.get().getRootMessageLogger(); } final public void run() @@ -41,13 +46,22 @@ public abstract class HouseKeepingTask implements Runnable // Don't need to undo this as this is a thread pool thread so will // always go through here before we do any real work. Thread.currentThread().setName(_name); + CurrentActor.set(new AbstractActor(_rootLogger) + { + @Override + public String getLogMessage() + { + return _name; + } + }); + try { execute(); } catch (Throwable e) { - _logger.warn(this.getClass().getSimpleName() + " throw exception: " + e); + _logger.warn(this.getClass().getSimpleName() + " throw exception: " + e, e); } } |
