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


Java LoggingLevel.ERROR属性代码示例

本文整理汇总了Java中org.apache.camel.LoggingLevel.ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java LoggingLevel.ERROR属性的具体用法?Java LoggingLevel.ERROR怎么用?Java LoggingLevel.ERROR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.camel.LoggingLevel的用法示例。


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

示例1: run

/**
 * Invoked whenever we should be polled
 */
public void run() {
    // avoid this thread to throw exceptions because the thread pool wont re-schedule a new thread
    try {
        // log starting
        if (LoggingLevel.ERROR == runLoggingLevel) {
            LOG.error("Scheduled task started on:   {}", this.getEndpoint());
        } else if (LoggingLevel.WARN == runLoggingLevel) {
            LOG.warn("Scheduled task started on:   {}", this.getEndpoint());
        } else if (LoggingLevel.INFO == runLoggingLevel) {
            LOG.info("Scheduled task started on:   {}", this.getEndpoint());
        } else if (LoggingLevel.DEBUG == runLoggingLevel) {
            LOG.debug("Scheduled task started on:   {}", this.getEndpoint());
        } else {
            LOG.trace("Scheduled task started on:   {}", this.getEndpoint());
        }

        // execute scheduled task
        doRun();

        // log completed
        if (LoggingLevel.ERROR == runLoggingLevel) {
            LOG.error("Scheduled task completed on: {}", this.getEndpoint());
        } else if (LoggingLevel.WARN == runLoggingLevel) {
            LOG.warn("Scheduled task completed on: {}", this.getEndpoint());
        } else if (LoggingLevel.INFO == runLoggingLevel) {
            LOG.info("Scheduled task completed on: {}", this.getEndpoint());
        } else if (LoggingLevel.DEBUG == runLoggingLevel) {
            LOG.debug("Scheduled task completed on: {}", this.getEndpoint());
        } else {
            LOG.trace("Scheduled task completed on: {}", this.getEndpoint());
        }

    } catch (Error e) {
        // must catch Error, to ensure the task is re-scheduled
        LOG.error("Error occurred during running scheduled task on: " + this.getEndpoint() + ", due: " + e.getMessage(), e);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:40,代码来源:ScheduledPollConsumer.java

示例2: logTransactionCommit

/**
 * Logs the transaction commit
 */
private void logTransactionCommit(String redelivered, String ids) {
    if ("true".equals(redelivered)) {
        // okay its a redelivered message so log at INFO level if rollbackLoggingLevel is INFO or higher
        // this allows people to know that the redelivered message was committed this time
        if (rollbackLoggingLevel == LoggingLevel.INFO || rollbackLoggingLevel == LoggingLevel.WARN || rollbackLoggingLevel == LoggingLevel.ERROR) {
            log.info("Transaction commit ({}) redelivered({}) for {})", new Object[]{transactionKey, redelivered, ids});
            // return after we have logged
            return;
        }
    }

    // log non redelivered by default at DEBUG level
    log.debug("Transaction commit ({}) redelivered({}) for {})", new Object[]{transactionKey, redelivered, ids});
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:TransactionErrorHandler.java

示例3: logTransactionRollback

/**
 * Logs the transaction rollback.
 */
private void logTransactionRollback(String redelivered, String ids, Throwable e, boolean rollbackOnly) {
    if (rollbackLoggingLevel == LoggingLevel.OFF) {
        return;
    } else if (rollbackLoggingLevel == LoggingLevel.ERROR && log.isErrorEnabled()) {
        if (rollbackOnly) {
            log.error("Transaction rollback ({}) redelivered({}) for {} due exchange was marked for rollbackOnly", new Object[]{transactionKey, redelivered, ids});
        } else {
            log.error("Transaction rollback ({}) redelivered({}) for {} caught: {}", new Object[]{transactionKey, redelivered, ids, e.getMessage()});
        }
    } else if (rollbackLoggingLevel == LoggingLevel.WARN && log.isWarnEnabled()) {
        if (rollbackOnly) {
            log.warn("Transaction rollback ({}) redelivered({}) for {} due exchange was marked for rollbackOnly", new Object[]{transactionKey, redelivered, ids});
        } else {
            log.warn("Transaction rollback ({}) redelivered({}) for {} caught: {}", new Object[]{transactionKey, redelivered, ids, e.getMessage()});
        }
    } else if (rollbackLoggingLevel == LoggingLevel.INFO && log.isInfoEnabled()) {
        if (rollbackOnly) {
            log.info("Transaction rollback ({}) redelivered({}) for {} due exchange was marked for rollbackOnly", new Object[]{transactionKey, redelivered, ids});
        } else {
            log.info("Transaction rollback ({}) redelivered({}) for {} caught: {}", new Object[]{transactionKey, redelivered, ids, e.getMessage()});
        }
    } else if (rollbackLoggingLevel == LoggingLevel.DEBUG && log.isDebugEnabled()) {
        if (rollbackOnly) {
            log.debug("Transaction rollback ({}) redelivered({}) for {} due exchange was marked for rollbackOnly", new Object[]{transactionKey, redelivered, ids});
        } else {
            log.debug("Transaction rollback ({}) redelivered({}) for {} caught: {}", new Object[]{transactionKey, redelivered, ids, e.getMessage()});
        }
    } else if (rollbackLoggingLevel == LoggingLevel.TRACE && log.isTraceEnabled()) {
        if (rollbackOnly) {
            log.trace("Transaction rollback ({}) redelivered({}) for {} due exchange was marked for rollbackOnly", new Object[]{transactionKey, redelivered, ids});
        } else {
            log.trace("Transaction rollback ({}) redelivered({}) for {} caught: {}", new Object[]{transactionKey, redelivered, ids, e.getMessage()});
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:38,代码来源:TransactionErrorHandler.java

示例4: createLogger

protected CamelLogger createLogger() {
    return new CamelLogger(LoggerFactory.getLogger(DefaultErrorHandler.class), LoggingLevel.ERROR);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:3,代码来源:DefaultErrorHandlerBuilder.java

示例5: createLogger

protected CamelLogger createLogger() {
    return new CamelLogger(LoggerFactory.getLogger(DeadLetterChannel.class), LoggingLevel.ERROR);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:3,代码来源:DeadLetterChannelBuilder.java

示例6: createLogger

protected CamelLogger createLogger() {
    return new CamelLogger(LoggerFactory.getLogger(TransactionErrorHandler.class), LoggingLevel.ERROR);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:3,代码来源:TransactionErrorHandlerBuilder.java


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