Commit e428cb5e authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1095: Make plugin lifecycle logging uniform.

This commit adds more structure to the logging done when loading and unloading
plugins.

The plugin manager was adapted to create log statements for loading and unloading
each plugin. It also logs to std-out for log statements of priority INFO and above.
This mimics what some (but not all) plugins were doing internally.

There's an added log statement that informs that the loading of the entire set of
plugins has finished (which helps users to determine when Openfire is ready to be
used).

Corresponding log statements from individual plugins have been removed.
parent 7630cc40
...@@ -65,6 +65,21 @@ ...@@ -65,6 +65,21 @@
</layout> </layout>
</appender> </appender>
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.EnhancedPatternLayout">
<param name="ConversionPattern" value="%m%n%throwable{0}" />
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="info" />
<param name="AcceptOnMatch" value="true" />
</filter>
</appender>
<!-- OF-1095: Uniform output of loading/unloading of plugins to std-out. -->
<logger name="org.jivesoftware.openfire.container.PluginManager">
<appender-ref ref="console"/>
</logger>
<!-- OF-506: Jetty INFO messages are generally not useful. Ignore them by default. --> <!-- OF-506: Jetty INFO messages are generally not useful. Ignore them by default. -->
<logger name="org.eclipse.jetty"> <logger name="org.eclipse.jetty">
<level value="warn" /> <level value="warn" />
......
...@@ -323,7 +323,7 @@ public class AdminConsolePlugin implements Plugin { ...@@ -323,7 +323,7 @@ public class AdminConsolePlugin implements Plugin {
adminServer.start(); adminServer.start();
} }
catch (Exception e) { catch (Exception e) {
Log.error(e.getMessage(), e); Log.error("An exception occurred while restarting the admin console:", e);
} }
} }
......
...@@ -30,8 +30,6 @@ public class BookmarksPlugin implements Plugin ...@@ -30,8 +30,6 @@ public class BookmarksPlugin implements Plugin
public void initializePlugin( PluginManager manager, File pluginDirectory ) public void initializePlugin( PluginManager manager, File pluginDirectory )
{ {
System.out.println( "Starting Bookmarks Plugin" );
boolean foundIncompatiblePlugin = false; boolean foundIncompatiblePlugin = false;
try try
{ {
......
...@@ -48,8 +48,6 @@ public class ClientControlPlugin implements Plugin { ...@@ -48,8 +48,6 @@ public class ClientControlPlugin implements Plugin {
// Plugin Interface // Plugin Interface
public void initializePlugin(PluginManager manager, File pluginDirectory) { public void initializePlugin(PluginManager manager, File pluginDirectory) {
System.out.println("Starting Client Control Plugin");
// Check if we Enterprise is installed and stop loading this plugin if found // Check if we Enterprise is installed and stop loading this plugin if found
File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins"); File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
File[] jars = pluginDir.listFiles(new FileFilter() { File[] jars = pluginDir.listFiles(new FileFilter() {
......
...@@ -44,8 +44,6 @@ public class ClusteringPlugin implements Plugin { ...@@ -44,8 +44,6 @@ public class ClusteringPlugin implements Plugin {
private static final String COHERENCE_CACHE_CONFIG = "coherence-cache-config"; private static final String COHERENCE_CACHE_CONFIG = "coherence-cache-config";
public void initializePlugin(PluginManager manager, File pluginDirectory) { public void initializePlugin(PluginManager manager, File pluginDirectory) {
System.out.println("Starting Clustering Plugin");
// Check if we Enterprise is installed and stop loading this plugin if found // Check if we Enterprise is installed and stop loading this plugin if found
File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins"); File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
File[] jars = pluginDir.listFiles(new FileFilter() { File[] jars = pluginDir.listFiles(new FileFilter() {
......
...@@ -54,8 +54,6 @@ public class FastpathPlugin implements Plugin, ClusterEventListener { ...@@ -54,8 +54,6 @@ public class FastpathPlugin implements Plugin, ClusterEventListener {
private WorkgroupManager workgroupManager; private WorkgroupManager workgroupManager;
public void initializePlugin(PluginManager manager, File pluginDirectory) { public void initializePlugin(PluginManager manager, File pluginDirectory) {
System.out.println("Starting Fastpath Server");
// Check if we Enterprise is installed and stop loading this plugin if found // Check if we Enterprise is installed and stop loading this plugin if found
File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins"); File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
File[] jars = pluginDir.listFiles(new FileFilter() { File[] jars = pluginDir.listFiles(new FileFilter() {
......
...@@ -54,7 +54,6 @@ public class RemoteRosterPlugin implements Plugin { ...@@ -54,7 +54,6 @@ public class RemoteRosterPlugin implements Plugin {
private GojaraAdminManager gojaraAdminManager = GojaraAdminManager.getInstance(); private GojaraAdminManager gojaraAdminManager = GojaraAdminManager.getInstance();
public void initializePlugin(PluginManager manager, File pluginDirectory) { public void initializePlugin(PluginManager manager, File pluginDirectory) {
Log.info("Starting RemoteRoster Plugin");
pluginManager = manager; pluginManager = manager;
iManager.addInterceptor(mainInterceptor); iManager.addInterceptor(mainInterceptor);
manageExternalComponents(); manageExternalComponents();
...@@ -125,7 +124,6 @@ public class RemoteRosterPlugin implements Plugin { ...@@ -125,7 +124,6 @@ public class RemoteRosterPlugin implements Plugin {
} }
public void destroyPlugin() { public void destroyPlugin() {
Log.info("Destroying GoJara");
mainInterceptor.freeze(); mainInterceptor.freeze();
iManager.removeInterceptor(mainInterceptor); iManager.removeInterceptor(mainInterceptor);
PropertyEventDispatcher.removeListener(_settingsObserver); PropertyEventDispatcher.removeListener(_settingsObserver);
......
...@@ -56,8 +56,6 @@ public class HazelcastPlugin extends TimerTask implements Plugin { ...@@ -56,8 +56,6 @@ public class HazelcastPlugin extends TimerTask implements Plugin {
@Override @Override
public void run() { public void run() {
System.out.println("Starting Hazelcast Clustering Plugin");
// Check if another cluster is installed and stop loading this plugin if found // Check if another cluster is installed and stop loading this plugin if found
File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins"); File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
File[] jars = pluginDir.listFiles(new FileFilter() { File[] jars = pluginDir.listFiles(new FileFilter() {
......
...@@ -162,8 +162,6 @@ public class MonitoringPlugin implements Plugin { ...@@ -162,8 +162,6 @@ public class MonitoringPlugin implements Plugin {
xep0313Support = new Xep0313Support(XMPPServer.getInstance()); xep0313Support = new Xep0313Support(XMPPServer.getInstance());
xep0313Support.start(); xep0313Support.start();
System.out.println("Starting Monitoring Plugin");
// Check if we Enterprise is installed and stop loading this plugin if // Check if we Enterprise is installed and stop loading this plugin if
// found // found
File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins"); File pluginDir = new File(JiveGlobals.getHomeDirectory(), "plugins");
......
...@@ -40,7 +40,6 @@ public class PacketFilterPlugin implements Plugin, PacketInterceptor, PropertyEv ...@@ -40,7 +40,6 @@ public class PacketFilterPlugin implements Plugin, PacketInterceptor, PropertyEv
public void initializePlugin(PluginManager manager, File pluginDirectory) { public void initializePlugin(PluginManager manager, File pluginDirectory) {
// register with interceptor manager // register with interceptor manager
Log.info("Packet Filter loaded...");
interceptorManager.addInterceptor(this); interceptorManager.addInterceptor(this);
pluginManager = manager; pluginManager = manager;
pf = PacketFilter.getInstance(); pf = PacketFilter.getInstance();
......
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