summaryrefslogtreecommitdiff
path: root/java/broker/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/broker/src')
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java b/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java
index e1e6cb49b5..1ab9d913c8 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagementMBean.java
@@ -753,4 +753,41 @@ public class LoggingManagementMBean extends AMQManagedObject implements LoggingM
LOCK.unlock();
}
}
+
+ public synchronized void reloadConfigFile() throws IOException
+ {
+ try
+ {
+ LOCK.lock();
+
+ QpidLog4JConfigurator.configure(_log4jConfigFileName);
+ _logger.info("Applied log4j configuration from: " + _log4jConfigFileName);
+ }
+ catch (IllegalLoggerLevelException e)
+ {
+ _logger.warn("The log4j configuration reload request was aborted: " + e);
+ //recommended that MBeans should use standard java.* and javax.* exceptions only
+ throw new IOException("The log4j configuration reload request was aborted: " + e.getMessage());
+ }
+ catch (ParserConfigurationException e)
+ {
+ _logger.warn("The log4j configuration reload request was aborted: " + e);
+ throw new IOException("The log4j configuration reload request was aborted: " + e.getMessage());
+ }
+ catch (SAXException e)
+ {
+ _logger.warn("The log4j configuration reload request was aborted: " + e);
+ //recommended that MBeans should use standard java.* and javax.* exceptions only
+ throw new IOException("The log4j configuration reload request was aborted: " + e.getMessage());
+ }
+ catch (IOException e)
+ {
+ _logger.warn("The log4j configuration reload request was aborted: " + e);
+ throw new IOException("The log4j configuration reload request was aborted: " + e.getMessage());
+ }
+ finally
+ {
+ LOCK.unlock();
+ }
+ }
}