当前位置: 首页>>代码示例>>Java>>正文


Java ErrorHandler类代码示例

本文整理汇总了Java中org.apache.logging.log4j.core.ErrorHandler的典型用法代码示例。如果您正苦于以下问题:Java ErrorHandler类的具体用法?Java ErrorHandler怎么用?Java ErrorHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ErrorHandler类属于org.apache.logging.log4j.core包,在下文中一共展示了ErrorHandler类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RocketmqLog4j2Appender

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout,
                                 boolean ignoreExceptions, String nameServerAddress, String producerGroup,
                                 String topic, String tag) {
    super(name, filter, layout, ignoreExceptions);
    this.producer = producer;
    this.topic = topic;
    this.tag = tag;
    this.nameServerAddress = nameServerAddress;
    this.producerGroup = producerGroup;
    try {
        this.producer = ProducerInstance.getInstance(this.nameServerAddress, this.producerGroup);
    } catch (Exception e) {
        ErrorHandler handler = this.getHandler();
        if (handler != null) {
            handler.error("Starting RocketmqLog4j2Appender [" + this.getName()
                    + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
        }
    }
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:20,代码来源:RocketmqLog4j2Appender.java

示例2: stop

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
/**
 * When system exit,this method will be called to close resources
 *
 * @param timeout
 * @param timeUnit
 * @return
 */
public boolean stop(long timeout, TimeUnit timeUnit) {
    this.setStopping();
    try {
        ProducerInstance.removeAndClose(this.nameServerAddress, this.producerGroup);
    } catch (Exception e) {
        ErrorHandler handler = this.getHandler();
        if (handler != null) {
            handler.error("Closeing RocketmqLog4j2Appender [" + this.getName()
                    + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
        }
    }

    boolean stopped = super.stop(timeout, timeUnit, false);
    this.setStopped();
    return stopped;
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:24,代码来源:RocketmqLog4j2Appender.java

示例3: RocketmqLog4j2Appender

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
protected RocketmqLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout,
    boolean ignoreExceptions, String nameServerAddress, String producerGroup,
    String topic, String tag) {
    super(name, filter, layout, ignoreExceptions);
    this.producer = producer;
    this.topic = topic;
    this.tag = tag;
    this.nameServerAddress = nameServerAddress;
    this.producerGroup = producerGroup;
    try {
        this.producer = ProducerInstance.getProducerInstance().getInstance(this.nameServerAddress, this.producerGroup);
    } catch (Exception e) {
        ErrorHandler handler = this.getHandler();
        if (handler != null) {
            handler.error("Starting RocketmqLog4j2Appender [" + this.getName()
                + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
        }
    }
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:20,代码来源:RocketmqLog4j2Appender.java

示例4: stop

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
/**
 * When system exit,this method will be called to close resources
 */
public boolean stop(long timeout, TimeUnit timeUnit) {
    this.setStopping();
    try {
        ProducerInstance.getProducerInstance().removeAndClose(this.nameServerAddress, this.producerGroup);
    } catch (Exception e) {
        ErrorHandler handler = this.getHandler();
        if (handler != null) {
            handler.error("Closeing RocketmqLog4j2Appender [" + this.getName()
                + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
        }
    }

    boolean stopped = super.stop(timeout, timeUnit, false);
    this.setStopped();
    return stopped;
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:20,代码来源:RocketmqLog4j2Appender.java

示例5: setHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
/**
 * The handler must be set before the appender is started.
 * @param handler The ErrorHandler to use.
 */
@Override
public void setHandler(final ErrorHandler handler) {
    if (handler == null) {
        LOGGER.error("The handler cannot be set to null");
    }
    if (isStarted()) {
        LOGGER.error("The handler cannot be changed once the appender is started");
        return;
    }
    this.handler = handler;
}
 
开发者ID:OuZhencong,项目名称:log4j2,代码行数:16,代码来源:AbstractAppender.java

示例6: setHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
/**
 * The handler must be set before the appender is started.
 * 
 * @param handler The ErrorHandler to use.
 */
@Override
public void setHandler(final ErrorHandler handler) {
    if (handler == null) {
        LOGGER.error("The handler cannot be set to null");
    }
    if (isStarted()) {
        LOGGER.error("The handler cannot be changed once the appender is started");
        return;
    }
    this.handler = handler;
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:17,代码来源:AbstractAppender.java

示例7: getHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
@Override
public ErrorHandler getHandler() {
    return errorHandler;
}
 
开发者ID:vy,项目名称:log4j2-redis-appender,代码行数:5,代码来源:RedisAppender.java

示例8: setHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
@Override
public void setHandler(ErrorHandler errorHandler) {
    this.errorHandler = errorHandler;
}
 
开发者ID:vy,项目名称:log4j2-redis-appender,代码行数:5,代码来源:RedisAppender.java

示例9: getHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
@Override
public ErrorHandler getHandler() {
    throw new UnsupportedOperationException("Not implemented");
}
 
开发者ID:marccarre,项目名称:commons-testing,代码行数:5,代码来源:Log4j2CollectionAppender.java

示例10: setHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
@Override
public void setHandler(final ErrorHandler errorHandler) {
    throw new UnsupportedOperationException("Not implemented");
}
 
开发者ID:marccarre,项目名称:commons-testing,代码行数:5,代码来源:Log4j2CollectionAppender.java

示例11: getHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
/**
 * Returns the ErrorHandler, if any.
 * @return The ErrorHandler.
 */
@Override
public ErrorHandler getHandler() {
    return handler;
}
 
开发者ID:OuZhencong,项目名称:log4j2,代码行数:9,代码来源:AbstractAppender.java

示例12: getHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
@Override
public ErrorHandler getHandler() {
    return null;
}
 
开发者ID:rmichela,项目名称:Bukkit-SSHD,代码行数:5,代码来源:StreamHandlerAppender.java

示例13: setHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
@Override
public void setHandler(ErrorHandler errorHandler) {

}
 
开发者ID:rmichela,项目名称:Bukkit-SSHD,代码行数:5,代码来源:StreamHandlerAppender.java

示例14: getHandler

import org.apache.logging.log4j.core.ErrorHandler; //导入依赖的package包/类
/**
 * Returns the ErrorHandler, if any.
 * 
 * @return The ErrorHandler.
 */
@Override
public ErrorHandler getHandler() {
    return handler;
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:10,代码来源:AbstractAppender.java


注:本文中的org.apache.logging.log4j.core.ErrorHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。