return options;
}
public void execute(String commandName, final ConsoleInput ci, CommandLine commandLine)
{
Appender con = Logger.getRootLogger().getAppender("ConsoleAppender");
List args = commandLine.getArgList();
if ((con != null) && (!args.isEmpty())) {
String subcommand = (String) args.get(0);
if ("off".equalsIgnoreCase(subcommand) ) {
if ( args.size() == 1 ){
con.addFilter(new DenyAllFilter());
ci.out.println("> Console logging off");
}else{
String name = (String)args.get(1);
Object[] entry = (Object[])channel_listener_map.remove( name );
if ( entry == null ){
ci.out.println( "> Channel '" + name + "' not being logged" );
}else{
((LoggerChannel)entry[0]).removeListener((LoggerChannelListener)entry[1]);
ci.out.println( "> Channel '" + name + "' logging off" );
}
}
} else if ("on".equalsIgnoreCase(subcommand) ) {
if ( args.size() == 1 ){
if( commandLine.hasOption('f') )
{
// send log output to a file
String filename = commandLine.getOptionValue('f');
try
{
Appender newAppender = new FileAppender(new PatternLayout("%d{ISO8601} %c{1}-%p: %m%n"), filename, true);
newAppender.setName("ConsoleAppender");
Logger.getRootLogger().removeAppender(con);
Logger.getRootLogger().addAppender(newAppender);
ci.out.println("> Logging to filename: " + filename);
} catch (IOException e)
{