Setting Up and Calling the Logging Plug-In

1. Add these two import statements to your main Plugin class:

import org.apache.log4j.Logger;

import com.unisys.logging.core.PluginLogManager;

2. Declare these two class-level objects:

private PluginLogManager logManager;

static public Logger logger;

3.  Include this code in the Start method for your plug-in:

logManager = new PluginLogManager(this);

logManager.configure(LOG_PROPERTIES_FILE);

logger = logManager.getLogger("your.logger.name");

where

LOG_PROPERTIES_FILE is the name of the logger configuration file included in your plug-in’s directory.

your.logger.name” is the name you choose to give your logger, which is defined in logger configuration file.

If you instantiate a single PluginLogManager and Logger in the central, or core, plug-in, the classes in all the other plug-ins can use it. Optionally, if you have several plug-ins or a feature made of many related plug-ins, you can instantiate a separate PluginLogManager and Logger in each plug-in, giving each one a unique name.

Method Calls

In each class where you want to make logging calls, include method calls as follows:

ClassWithLogger.logger.debug("debug log message");