Package org.apache.log4j.varia

Examples of org.apache.log4j.varia.DenyAllFilter


    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);
         
View Full Code Here


  public static void initRootLogger() {
    if (Logger.getRootLogger().getAppender("ConsoleAppender")==null) {
      Appender app;
      app = new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN));
      app.setName("ConsoleAppender");
      app.addFilter( new DenyAllFilter() )//'log off' by default
      Logger.getRootLogger().addAppender(app);
    }
  }
View Full Code Here

       
    if (Logger.getRootLogger().getAppender("ConsoleAppender")==null) {
        Appender app;
        app = new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN));
        app.setName("ConsoleAppender");
        app.addFilter( new DenyAllFilter() )//'log off' by default
        Logger.getRootLogger().addAppender(app);
      }
   
    initialise();
  }
View Full Code Here

     // attach match filter to appender
    appender.addFilter(matchFilter);
  
    // attach DenyAllFilter to end of filter chain to deny neutral
    // (non matching) messages
    appender.addFilter(new DenyAllFilter());
       
    // set appender on root and set level to debug
    root.addAppender(appender);
    root.setLevel(Level.TRACE);
   
View Full Code Here

  public void addAppender(final Appender newAppender) {
    synchronized (appenders) {
      // We don't want the downstream appender to receive logging events via the normal Log4J
      // mechanism; we only want it to receive the logging events that WE send to it. So we add
      // the DenyAllFilter so that Log4J does not deliver logging events to it.
      newAppender.addFilter(new DenyAllFilter());
      appenders.addAppender(newAppender);
    }
  }
View Full Code Here

      }
      // To deliver the consolidated event to the downstream appender, we temporarily
      // remove and then reinstate the DenyAllFilter
      downstreamAppender.clearFilters();
      downstreamAppender.doAppend(eventToSendDownstream);
      downstreamAppender.addFilter(new DenyAllFilter());
    }
  }
View Full Code Here

    */
    public static void removeDefaultConsole ()
    {
        Appender defaultConsole = Logger.getRootLogger().getAppender("DefaultConsole");
        if (defaultConsole != null) {
            defaultConsole.addFilter(new DenyAllFilter());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.log4j.varia.DenyAllFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.