ch.qos.logback.core.AppenderBase类的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(223)

本文整理了Java中ch.qos.logback.core.AppenderBase类的一些代码示例,展示了AppenderBase类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppenderBase类的具体详情如下:
包路径:ch.qos.logback.core.AppenderBase
类名称:AppenderBase

AppenderBase介绍

[英]Sets a skeleton implementation for appenders.

For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#AppenderBase
[中]设置附加器的框架实现。
有关此附件的更多信息,请参阅联机手册http://logback.qos.ch/manual/appenders.html#AppenderBase

代码示例

代码示例来源:origin: signalapp/Signal-Server

@Override
public void start() {
 super.start();
 synchronized (this) {
  try {
   Class syslogClass = syslogConfig.getSyslogClass();
   syslog = (SyslogIF) syslogClass.newInstance();
   syslog.initialize(syslogClass.getSimpleName(), syslogConfig);
  } catch (ClassCastException | IllegalAccessException | InstantiationException cse) {
   throw new SyslogRuntimeException(cse);
  }
 }
}

代码示例来源:origin: gocd/gocd

@Override
  public void stop() {
    super.stop();
    clear();
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public synchronized void doAppend(E eventObject) {
 // WARNING: The guard check MUST be the first statement in the
 // doAppend() method.
 // prevent re-entry.
 if (guard) {
  return;
 }
 try {
  guard = true;
  if (!this.started) {
   if (statusRepeatCount++ < ALLOWED_REPEATS) {
    addStatus(new WarnStatus(
      "Attempted to append to non started appender [" + name + "].",
      this));
   }
   return;
  }
  if (getFilterChainDecision(eventObject) == FilterReply.DENY) {
   return;
  }
  // ok, we now invoke derived class' implementation of append
  this.append(eventObject);
 } catch (Exception e) {
  if (exceptionCount++ < ALLOWED_REPEATS) {
   addError("Appender [" + name + "] failed to append.", e);
  }
 } finally {
  guard = false;
 }
}

代码示例来源:origin: apache/rocketmq

/**
 * Options are activated and become effective only after calling this method.
 */
public void start() {
  int errors = 0;
  if (this.layout == null) {
    addStatus(new ErrorStatus("No layout set for the RocketmqLogbackAppender named \"" + name + "\".", this));
    errors++;
  }
  if (errors > 0 || !checkEntryConditions()) {
    return;
  }
  try {
    producer = ProducerInstance.getProducerInstance().getInstance(nameServerAddress, producerGroup);
  } catch (Exception e) {
    addError("Starting RocketmqLogbackAppender [" + this.getName()
      + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
  }
  if (producer != null) {
    super.start();
  }
}

代码示例来源:origin: signalapp/Signal-Server

@Override
public void stop() {
 super.stop();
 synchronized(this) {
  if (syslog != null) {
   syslog.shutdown();
   syslog = null;
  }
 }
}

代码示例来源:origin: tony19/logback-android

public synchronized void doAppend(E eventObject) {
 // WARNING: The guard check MUST be the first statement in the
 // doAppend() method.
 // prevent re-entry.
 if (guard) {
  return;
 }
 try {
  guard = true;
  if (!this.started) {
   if (statusRepeatCount++ < ALLOWED_REPEATS) {
    addStatus(new WarnStatus(
      "Attempted to append to non started appender [" + name + "].",
      this));
   }
   return;
  }
  if (getFilterChainDecision(eventObject) == FilterReply.DENY) {
   return;
  }
  // ok, we now invoke derived class' implementation of append
  this.append(eventObject);
 } catch (Exception e) {
  if (exceptionCount++ < ALLOWED_REPEATS) {
   addError("Appender [" + name + "] failed to append.", e);
  }
 } finally {
  guard = false;
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void start() {
 cb = new CyclicBuffer<E>(maxSize);
 super.start();
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void stop() {
 cb = null;
 super.stop();
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

public synchronized void doAppend(E eventObject) {
  // WARNING: The guard check MUST be the first statement in the
  // doAppend() method.
  // prevent re-entry.
  if (guard) {
    return;
  }
  try {
    guard = true;
    if (!this.started) {
      if (statusRepeatCount++ < ALLOWED_REPEATS) {
        addStatus(new WarnStatus("Attempted to append to non started appender [" + name + "].", this));
      }
      return;
    }
    if (getFilterChainDecision(eventObject) == FilterReply.DENY) {
      return;
    }
    // ok, we now invoke derived class' implementation of append
    this.append(eventObject);
  } catch (Exception e) {
    if (exceptionCount++ < ALLOWED_REPEATS) {
      addError("Appender [" + name + "] failed to append.", e);
    }
  } finally {
    guard = false;
  }
}

代码示例来源:origin: didi/DDMQ

/**
 * Options are activated and become effective only after calling this method.
 */
public void start() {
  int errors = 0;
  if (this.layout == null) {
    addStatus(new ErrorStatus("No layout set for the RocketmqLogbackAppender named \"" + name + "\".", this));
    errors++;
  }
  if (errors > 0 || !checkEntryConditions()) {
    return;
  }
  try {
    producer = ProducerInstance.getProducerInstance().getInstance(nameServerAddress, producerGroup);
  } catch (Exception e) {
    addError("Starting RocketmqLogbackAppender [" + this.getName()
      + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
  }
  if (producer != null) {
    super.start();
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public void stop() {
 if (sos != null) {
  sos.close();
 }
 super.stop();
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

public synchronized void doAppend(E eventObject) {
  // WARNING: The guard check MUST be the first statement in the
  // doAppend() method.
  // prevent re-entry.
  if (guard) {
    return;
  }
  try {
    guard = true;
    if (!this.started) {
      if (statusRepeatCount++ < ALLOWED_REPEATS) {
        addStatus(new WarnStatus("Attempted to append to non started appender [" + name + "].", this));
      }
      return;
    }
    if (getFilterChainDecision(eventObject) == FilterReply.DENY) {
      return;
    }
    // ok, we now invoke derived class' implementation of append
    this.append(eventObject);
  } catch (Exception e) {
    if (exceptionCount++ < ALLOWED_REPEATS) {
      addError("Appender [" + name + "] failed to append.", e);
    }
  } finally {
    guard = false;
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

peerId = "remote peer " + remoteHost + ":" + port + ": ";
task = getContext().getExecutorService().submit(this);
super.start();

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * {@inheritDoc}
 */
@Override
public void stop() {
 if (!isStarted()) return;
 CloseUtil.closeQuietly(socket);
 task.cancel(true);
 if(connectorTask != null)
  connectorTask.cancel(true);
 super.stop();
}

代码示例来源:origin: Nextdoor/bender

public synchronized void doAppend(E eventObject) {
  // WARNING: The guard check MUST be the first statement in the
  // doAppend() method.
  // prevent re-entry.
  if (guard) {
    return;
  }
  try {
    guard = true;
    if (!this.started) {
      if (statusRepeatCount++ < ALLOWED_REPEATS) {
        addStatus(new WarnStatus("Attempted to append to non started appender [" + name + "].", this));
      }
      return;
    }
    if (getFilterChainDecision(eventObject) == FilterReply.DENY) {
      return;
    }
    // ok, we now invoke derived class' implementation of append
    this.append(eventObject);
  } catch (Exception e) {
    if (exceptionCount++ < ALLOWED_REPEATS) {
      addError("Appender [" + name + "] failed to append.", e);
    }
  } finally {
    guard = false;
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public void start() {
 if (isStarted()) return;
 try {
  ServerSocket socket = getServerSocketFactory().createServerSocket(
    getPort(), getBacklog(), getInetAddress());    
  ServerListener<RemoteReceiverClient> listener = createServerListener(socket);
  
  runner = createServerRunner(listener, getContext().getExecutorService());
  runner.setContext(getContext());
  getContext().getExecutorService().execute(runner);
  super.start();
 } catch (Exception ex) {
  addError("server startup error: " + ex, ex);
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public void stop() {
 if (!isStarted()) return;
 try {
  runner.stop();
  super.stop();
 }
 catch (IOException ex) {
  addError("server shutdown error: " + ex, ex);
 }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

public synchronized void doAppend(E eventObject) {
 // WARNING: The guard check MUST be the first statement in the
 // doAppend() method.
 // prevent re-entry.
 if (guard) {
  return;
 }
 try {
  guard = true;
  if (!this.started) {
   if (statusRepeatCount++ < ALLOWED_REPEATS) {
    addStatus(new WarnStatus(
      "Attempted to append to non started appender [" + name + "].",
      this));
   }
   return;
  }
  if (getFilterChainDecision(eventObject) == FilterReply.DENY) {
   return;
  }
  // ok, we now invoke derived class' implementation of append
  this.append(eventObject);
 } catch (Exception e) {
  if (exceptionCount++ < ALLOWED_REPEATS) {
   addError("Appender [" + name + "] failed to append.", e);
  }
 } finally {
  guard = false;
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

super.start();

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

@Override
 public void stop() {
  super.stop();
 }
}

相关文章