Commit f4d3e2e8 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Check for unexpected log implementation to avoid blowing up if unexpected...

Check for unexpected log implementation to avoid blowing up if unexpected libraries have stomped on commons-logging settings (JM-622).

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3681 b35dd754-fafc-0310-a699-88a17e54d16e
parent 0d9e77d5
/** /**
* $RCSfile$
* $Revision: 3034 $ * $Revision: 3034 $
* $Date: 2005-11-04 21:02:33 -0300 (Fri, 04 Nov 2005) $ * $Date: 2005-11-04 21:02:33 -0300 (Fri, 04 Nov 2005) $
* *
* Copyright (C) 2004-2006 Jive Software. All rights reserved.
* Copyright (C) 2004 Jive Software. All rights reserved.
* *
* This software is published under the terms of the GNU Public License (GPL), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
*/ */
package org.jivesoftware.wildfire.container; package org.jivesoftware.wildfire.container;
...@@ -164,15 +154,21 @@ public class AdminConsolePlugin implements Plugin { ...@@ -164,15 +154,21 @@ public class AdminConsolePlugin implements Plugin {
File logFile = new File(logDir, "admin-console.log"); File logFile = new File(logDir, "admin-console.log");
OutputStreamLogSink logSink = new OutputStreamLogSink(logFile.toString()); OutputStreamLogSink logSink = new OutputStreamLogSink(logFile.toString());
logSink.start(); logSink.start();
LogImpl log = (LogImpl) Factory.getFactory().getInstance(""); // In some cases, commons-logging settings can be stomped by other
// Ignore INFO logs unless debugging turned on. // libraries in the classpath. Make sure that hasn't happened before
if (!Log.isDebugEnabled()) { // setting configuration.
log.setVerbose(-1); Object logImpl = Factory.getFactory().getInstance("");
} if (logImpl instanceof LogImpl) {
else { LogImpl log = (LogImpl)logImpl;
log.setVerbose(1); // Ignore INFO logs unless debugging turned on.
if (!Log.isDebugEnabled()) {
log.setVerbose(-1);
}
else {
log.setVerbose(1);
}
log.add(logSink);
} }
log.add(logSink);
jetty = new Server(); jetty = new Server();
......
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