protected void startPlugin() throws PluginException {
final Logger root = Logger.getRootLogger();
try {
// Create the appenders
final ConsoleManager conMgr = InitialNaming.lookup(ConsoleManager.NAME);
final TextConsole console =
(TextConsole) conMgr.createConsole(
"Log4j",
(ConsoleManager.CreateOptions.TEXT |
ConsoleManager.CreateOptions.SCROLLABLE |
ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR |
ConsoleManager.CreateOptions.NO_LINE_EDITTING));
conMgr.registerConsole(console);
console.setAcceleratorKeyCode(KeyEvent.VK_F7);
final VirtualConsoleAppender debugApp =
new VirtualConsoleAppender(new PatternLayout(LAYOUT), console, false);
debugApp.setThreshold(Level.DEBUG);
BootLogInstance.get().setDebugOut(new PrintStream(new WriterOutputStream(console.getOut(), false), true));
TextConsole atc = new ActiveTextConsole(conMgr);
final VirtualConsoleAppender infoApp = new VirtualConsoleAppender(
new PatternLayout(LAYOUT), atc, false);
infoApp.setThreshold(Level.INFO);
// Add the new appenders