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);
}
}
}
java类org.apache.log4j.spi.ErrorHandler的实例源码
PropertyConfigurator.java 文件源码
项目:daq-eclipse
阅读 25
收藏 0
点赞 0
评论 0
QuietWriter.java 文件源码
项目:cacheonix-core
阅读 21
收藏 0
点赞 0
评论 0
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;
}
}
AppenderSkeleton.java 文件源码
项目:cacheonix-core
阅读 19
收藏 0
点赞 0
评论 0
/**
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;
}
}
WriterAppender.java 文件源码
项目:cacheonix-core
阅读 19
收藏 0
点赞 0
评论 0
/**
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);
}
}
}
QuietWriter.java 文件源码
项目:daq-eclipse
阅读 21
收藏 0
点赞 0
评论 0
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;
}
}
AppenderSkeleton.java 文件源码
项目:daq-eclipse
阅读 17
收藏 0
点赞 0
评论 0
/**
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;
}
}
WriterAppender.java 文件源码
项目:daq-eclipse
阅读 29
收藏 0
点赞 0
评论 0
/**
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);
}
}
}
PropertySetter.java 文件源码
项目:daq-eclipse
阅读 23
收藏 0
点赞 0
评论 0
/**
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;
}
QuietWriter.java 文件源码
项目:nabs
阅读 23
收藏 0
点赞 0
评论 0
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;
}
}
AppenderSkeleton.java 文件源码
项目:nabs
阅读 18
收藏 0
点赞 0
评论 0
/**
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;
}
}
WriterAppender.java 文件源码
项目:nabs
阅读 21
收藏 0
点赞 0
评论 0
/**
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);
}
}
}
FallbackAppender.java 文件源码
项目:spacewalk
阅读 26
收藏 0
点赞 0
评论 0
/**
* 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);
}
FailbackAppender.java 文件源码
项目:spacewalk
阅读 20
收藏 0
点赞 0
评论 0
/**
* 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);
}
AppenderSkeleton.java 文件源码
项目:logging-log4j2
阅读 19
收藏 0
点赞 0
评论 0
/**
* Set the {@link ErrorHandler} for this Appender.
*
* @since 0.9.0
*/
@Override
public synchronized void setErrorHandler(ErrorHandler eh) {
if (eh != null) {
this.errorHandler = eh;
}
}
StringAppender.java 文件源码
项目:sstore-soft
阅读 23
收藏 0
点赞 0
评论 0
@Override
public ErrorHandler getErrorHandler() {
// TODO Auto-generated method stub
return null;
}
StringAppender.java 文件源码
项目:sstore-soft
阅读 18
收藏 0
点赞 0
评论 0
@Override
public void setErrorHandler(ErrorHandler arg0) {
// TODO Auto-generated method stub
}
StringAppender.java 文件源码
项目:s-store
阅读 21
收藏 0
点赞 0
评论 0
@Override
public ErrorHandler getErrorHandler() {
// TODO Auto-generated method stub
return null;
}
StringAppender.java 文件源码
项目:s-store
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void setErrorHandler(ErrorHandler arg0) {
// TODO Auto-generated method stub
}
SingleMessageAppender.java 文件源码
项目:FSTestTools
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void setErrorHandler(ErrorHandler errorHandler) {
this.errorHandler = errorHandler;
}
SingleMessageAppender.java 文件源码
项目:FSTestTools
阅读 18
收藏 0
点赞 0
评论 0
@Override
public ErrorHandler getErrorHandler() {
return errorHandler;
}
AppenderForAsserts.java 文件源码
项目:FSTestTools
阅读 20
收藏 0
点赞 0
评论 0
@Override
public ErrorHandler getErrorHandler() {
return null;
}
Log4jALAAppender.java 文件源码
项目:Log4jALA
阅读 29
收藏 0
点赞 0
评论 0
@Override
public void setErrorHandler(ErrorHandler errorHandler) {
super.setErrorHandler(errorHandler);
}
Log4jALAAppender.java 文件源码
项目:Log4jALA
阅读 32
收藏 0
点赞 0
评论 0
@Override
public ErrorHandler getErrorHandler() {
return super.getErrorHandler();
}
Log4JRecordingAppender.java 文件源码
项目:reladomo
阅读 19
收藏 0
点赞 0
评论 0
public ErrorHandler getErrorHandler()
{
return null;
}
Log4JRecordingAppender.java 文件源码
项目:reladomo
阅读 18
收藏 0
点赞 0
评论 0
public void setErrorHandler(ErrorHandler errorHandler)
{
}
CliContextImplTest.java 文件源码
项目:FSDevTools
阅读 23
收藏 0
点赞 0
评论 0
@Override
public ErrorHandler getErrorHandler() {
return fallbackErrorHandler;
}
CountingQuietWriterEx.java 文件源码
项目:jcode
阅读 19
收藏 0
点赞 0
评论 0
public CountingQuietWriterEx(String key, String fileName, Writer writer, ErrorHandler eh) {
super(writer, eh);
this.key = key;
this.fileName = fileName;
}
QuietWriter.java 文件源码
项目:cacheonix-core
阅读 18
收藏 0
点赞 0
评论 0
public
QuietWriter(Writer writer, ErrorHandler errorHandler) {
super(writer);
setErrorHandler(errorHandler);
}
SyslogQuietWriter.java 文件源码
项目:cacheonix-core
阅读 20
收藏 0
点赞 0
评论 0
public
SyslogQuietWriter(Writer writer, int syslogFacility, ErrorHandler eh) {
super(writer, eh);
this.syslogFacility = syslogFacility;
}
CountingQuietWriter.java 文件源码
项目:cacheonix-core
阅读 24
收藏 0
点赞 0
评论 0
public
CountingQuietWriter(Writer writer, ErrorHandler eh) {
super(writer, eh);
}