Package org.apache.log4j

Examples of org.apache.log4j.AppenderSkeleton


   *
   * @param y
   * @return
   */
  protected AppenderSkeleton addLog(final YWindowStart y) {
    AppenderSkeleton a = new AppenderSkeleton() {

      @Override
      public boolean requiresLayout() {
        return false;
      }
View Full Code Here


    }

    public void setUpMockAppender() {
        appenders = Logger.getRootLogger().getAllAppenders();
        Logger.getRootLogger().removeAllAppenders();
        Logger.getRootLogger().addAppender(new AppenderSkeleton() {
            protected void append(LoggingEvent event) {
            }

            public void close() {
            }
View Full Code Here

        Logger logger = Logger.getLogger("com.force.sdk.jpa");
        Level oldLevel = logger.getLevel();
        logger.setLevel(Level.WARN);
        final AtomicBoolean receivedTableLog = new AtomicBoolean(false);
        final AtomicBoolean receivedFieldLog = new AtomicBoolean(false);
        Appender appender = new AppenderSkeleton() {
           
            private Pattern missingTablePat =
                Pattern.compile("Table does not exist in force.com and datanucleus.autoCreateTables is false,"
                                    + " table: [a-zA-Z0-9_$]*SimpleValidEntity__c");
            private Pattern missingFieldsPat =
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    ourShouldFail = false;

    Logger.getRootLogger().addAppender(new AppenderSkeleton() {
      @Override
      protected void append(LoggingEvent loggingEvent) {
        if (loggingEvent.level.isGreaterOrEqual(Priority.ERROR) ) {
          ourShouldFail = true;
        }
View Full Code Here

  @SuppressWarnings("unchecked")
  private void setLoggerAppendersLevel(Logger logger, Level level) {
    Enumeration e = logger.getAllAppenders();
    while (e.hasMoreElements()) {
      AppenderSkeleton appender = (AppenderSkeleton) e.nextElement();
      appender.setThreshold(level);
    }
  }
View Full Code Here

  // vv ScanCacheBatchExample
  private static void scan(int caching, int batch) throws IOException {
    Logger log = Logger.getLogger("org.apache.hadoop");
    final int[] counters = {0, 0};
    Appender appender = new AppenderSkeleton() {
      @Override
      protected void append(LoggingEvent event) {
        String msg = event.getMessage().toString();
        if (msg != null && msg.contains("Call: next")) {
          counters[0]++;
View Full Code Here

    /**
     * Initializes the log4j system to print all messages from {@link AnalyzeRuntime}
     * in <tt>System.out</tt>, and suppress all other non-error messages.
     */
    public static void setupLogger() {
        log.addAppender(new AppenderSkeleton() {
            @Override
            protected void append(LoggingEvent e) {
                if (e.getLevel() == Level.ERROR)
                    System.err.println("ERROR " + e.getRenderedMessage());
                else
View Full Code Here

    @Test
    public void testLargerThanWorld() throws Exception {
        // setup a logging "bomb" rigged to explode when the warning message we
        // want to eliminate
        org.apache.log4j.Logger l4jLogger = getLog4JLogger(GetMap.class, "LOGGER");
        l4jLogger.addAppender(new AppenderSkeleton() {

            @Override
            public boolean requiresLayout() {
                return false;
            }
View Full Code Here

        w = new Frame();
        w.setVisible( true );
       
        dd = findDataDirectory();
       
        LogManager.getRootLogger().addAppender(new AppenderSkeleton() {

            protected void append(LoggingEvent event) {
                w.addText( event.getMessage().toString() + "\n" );
            }
View Full Code Here

TOP

Related Classes of org.apache.log4j.AppenderSkeleton

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.