1 24 25 package org.objectweb.cjdbc.console.text.commands.controller; 26 27 import java.io.BufferedWriter ; 28 import java.io.File ; 29 import java.io.FileWriter ; 30 31 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 32 import org.objectweb.cjdbc.console.text.commands.ConsoleCommand; 33 import org.objectweb.cjdbc.console.text.module.AbstractConsoleModule; 34 35 40 public class ShowLoggingConfig extends ConsoleCommand 41 { 42 43 48 public ShowLoggingConfig(AbstractConsoleModule module) 49 { 50 super(module); 51 } 52 53 56 public void parse(String commandText) throws Exception 57 { 58 if (commandText == null || commandText.equalsIgnoreCase("")) 59 { 60 console.printInfo(jmxClient.getControllerProxy().getLoggingConfiguration()); 62 } 63 else 64 { 65 File f = new File (commandText.trim()); 67 BufferedWriter writer = new BufferedWriter (new FileWriter (f)); 68 writer.write(jmxClient.getControllerProxy().generateReport()); 69 writer.flush(); 70 writer.close(); 71 } 72 } 73 74 77 public String getCommandName() 78 { 79 return "show logging config"; 80 } 81 82 85 public String getCommandDescription() 86 { 87 return ConsoleTranslate.get("controller.command.show.logging.config"); 88 } 89 90 } | Popular Tags |