當前位置: 首頁>>代碼示例>>Java>>正文


Java ErrorHandler類代碼示例

本文整理匯總了Java中org.apache.log4j.spi.ErrorHandler的典型用法代碼示例。如果您正苦於以下問題:Java ErrorHandler類的具體用法?Java ErrorHandler怎麽用?Java ErrorHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ErrorHandler類屬於org.apache.log4j.spi包,在下文中一共展示了ErrorHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
private void parseErrorHandler(
  final ErrorHandler eh,
  final String errorHandlerPrefix,
  final Properties props, 
  final LoggerRepository hierarchy) {
boolean rootRef = OptionConverter.toBoolean(
			  OptionConverter.findAndSubst(errorHandlerPrefix + ROOT_REF, props), false);
if (rootRef) {
		  eh.setLogger(hierarchy.getRootLogger());
   }
String loggerName = OptionConverter.findAndSubst(errorHandlerPrefix + LOGGER_REF , props);
if (loggerName != null) {
	Logger logger = (loggerFactory == null) ? hierarchy.getLogger(loggerName)
	                : hierarchy.getLogger(loggerName, loggerFactory);
	eh.setLogger(logger);
}
String appenderName = OptionConverter.findAndSubst(errorHandlerPrefix + APPENDER_REF_TAG, props);
if (appenderName != null) {
	Appender backup = parseAppender(props, appenderName);
	if (backup != null) {
		eh.setBackupAppender(backup);
	}
}
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:25,代碼來源:PropertyConfigurator.java

示例2: setErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
public
void setErrorHandler(ErrorHandler eh) {
  if(eh == null) {
    // This is a programming error on the part of the enclosing appender.
    throw new IllegalArgumentException("Attempted to set null ErrorHandler.");
  } else { 
    this.errorHandler = eh;
  }
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:10,代碼來源:QuietWriter.java

示例3: setErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
/** 
    Set the {@link ErrorHandler} for this Appender.
    @since 0.9.0
*/
public
synchronized
void setErrorHandler(ErrorHandler eh) {
  if(eh == null) {
    // We do not throw exception here since the cause is probably a
    // bad config file.
    LogLog.warn("You have tried to set a null error-handler.");
  } else {
    this.errorHandler = eh;
  }
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:16,代碼來源:AppenderSkeleton.java

示例4: setErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
/**
    Set the {@link ErrorHandler} for this WriterAppender and also the
    underlying {@link QuietWriter} if any. */
 public synchronized void setErrorHandler(ErrorHandler eh) {
   if(eh == null) {
     LogLog.warn("You have tried to set a null error-handler.");
   } else {
     this.errorHandler = eh;
     if(this.qw != null) {
this.qw.setErrorHandler(eh);
     }
   }
 }
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:14,代碼來源:WriterAppender.java

示例5: convertArg

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
/**
   Convert <code>val</code> a String parameter to an object of a
   given type.
*/
protected
Object convertArg(String val, Class type) {
  if(val == null)
    return null;

  String v = val.trim();
  if (String.class.isAssignableFrom(type)) {
    return val;
  } else if (Integer.TYPE.isAssignableFrom(type)) {
    return new Integer(v);
  } else if (Long.TYPE.isAssignableFrom(type)) {
    return new Long(v);
  } else if (Boolean.TYPE.isAssignableFrom(type)) {
    if ("true".equalsIgnoreCase(v)) {
      return Boolean.TRUE;
    } else if ("false".equalsIgnoreCase(v)) {
      return Boolean.FALSE;
    }
  } else if (Priority.class.isAssignableFrom(type)) {
    return OptionConverter.toLevel(v, (Level) Level.DEBUG);
  } else if (ErrorHandler.class.isAssignableFrom(type)) {
    return OptionConverter.instantiateByClassName(v, 
 ErrorHandler.class, null);
  }
  return null;
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:31,代碼來源:PropertySetter.java

示例6: FallbackAppender

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
/**
 * Constructor
 */
public FallbackAppender() {
    ErrorHandler fb = new FallbackErrorHandler();
    this.setErrorHandler(fb);
    fb.setAppender(this);
    Appender rootAppen = Logger.getRootLogger().getAppender("RootAppender");

    if (rootAppen != null) {
        fb.setBackupAppender(rootAppen);
    }

    Logger logger = Logger.getLogger(LoggingInvocationProcessor.class);
    fb.setLogger(logger);
}
 
開發者ID:spacewalkproject,項目名稱:spacewalk,代碼行數:17,代碼來源:FallbackAppender.java

示例7: FailbackAppender

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
/**
 * Constructor
 */
public FailbackAppender() {
    ErrorHandler fb = new FallbackErrorHandler();
    this.setErrorHandler(fb);
    fb.setAppender(this);
    Appender rootAppen = Logger.getRootLogger().getAppender("RootAppender");

    if (rootAppen != null) {
        fb.setBackupAppender(rootAppen);
    }

    Logger logger = Logger.getLogger(LoggingInvocationProcessor.class);
    fb.setLogger(logger);
}
 
開發者ID:spacewalkproject,項目名稱:spacewalk,代碼行數:17,代碼來源:FailbackAppender.java

示例8: setErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
/**
 * Set the {@link ErrorHandler} for this Appender.
 *
 * @since 0.9.0
 */
@Override
public synchronized void setErrorHandler(ErrorHandler eh) {
    if (eh != null) {
        this.errorHandler = eh;
    }
}
 
開發者ID:apache,項目名稱:logging-log4j2,代碼行數:12,代碼來源:AppenderSkeleton.java

示例9: getErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
@Override
public ErrorHandler getErrorHandler() {
    // TODO Auto-generated method stub
    return null;
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:6,代碼來源:StringAppender.java

示例10: setErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
@Override
public void setErrorHandler(ErrorHandler arg0) {
    // TODO Auto-generated method stub
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:5,代碼來源:StringAppender.java

示例11: setErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
@Override
public void setErrorHandler(ErrorHandler errorHandler) {
    this.errorHandler = errorHandler;
}
 
開發者ID:e-Spirit,項目名稱:FSTestTools,代碼行數:5,代碼來源:SingleMessageAppender.java

示例12: getErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
@Override
public ErrorHandler getErrorHandler() {
    return errorHandler;
}
 
開發者ID:e-Spirit,項目名稱:FSTestTools,代碼行數:5,代碼來源:SingleMessageAppender.java

示例13: getErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
@Override
public ErrorHandler getErrorHandler() {
    return null;
}
 
開發者ID:e-Spirit,項目名稱:FSTestTools,代碼行數:5,代碼來源:AppenderForAsserts.java

示例14:

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
@Override
public void	setErrorHandler(ErrorHandler errorHandler) {
	super.setErrorHandler(errorHandler);
}
 
開發者ID:ptv-logistics,項目名稱:Log4jALA,代碼行數:5,代碼來源:Log4jALAAppender.java

示例15: getErrorHandler

import org.apache.log4j.spi.ErrorHandler; //導入依賴的package包/類
public ErrorHandler getErrorHandler()
{
    return null;
}
 
開發者ID:goldmansachs,項目名稱:reladomo,代碼行數:5,代碼來源:Log4JRecordingAppender.java


注:本文中的org.apache.log4j.spi.ErrorHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。