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


Java Logger.trace方法代码示例

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


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

示例1: execute

import org.apache.log4j.Logger; //导入方法依赖的package包/类
@Override
public boolean execute(Context javascriptContext, Scriptable scope) throws EngineException {
	if (isEnabled()) {
		if (super.execute(javascriptContext, scope)) {
			Logger log = engine ? Engine.logEngine : Engine.logContext;
			if(level.equals(Level.WARN.toString()) && log.isEnabledFor(Level.WARN))
				log.warn(getEvalString(javascriptContext, scope));
			else if(level.equals(Level.INFO.toString()) && log.isInfoEnabled())
				log.info(getEvalString(javascriptContext, scope));
			else if(level.equals(Level.DEBUG.toString()) && log.isDebugEnabled())
				log.debug(getEvalString(javascriptContext, scope));
			else if(level.equals(Level.TRACE.toString()) && log.isTraceEnabled())
				log.trace(getEvalString(javascriptContext, scope));
			else if(level.equals(Level.ERROR.toString()) && log.isEnabledFor(Level.ERROR))
				log.error(getEvalString(javascriptContext, scope));
			return true;
		}
	}
	return false;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:21,代码来源:LogStatement.java

示例2: logOnServer

import org.apache.log4j.Logger; //导入方法依赖的package包/类
@Override
public String logOnServer(LogRecord record) {
	try {
		if (iDeobfuscator != null && record.getThrown() != null)
			iDeobfuscator.deobfuscateStackTrace(record.getThrown(), getPermutationStrongName());
		Logger logger = Logger.getLogger(record.getLoggerName());
		if (record.getLevel().intValue() >= Level.SEVERE.intValue()) {
			logger.error(record.getMessage(), record.getThrown());
		} else if (record.getLevel().intValue() >= Level.WARNING.intValue()) {
			logger.warn(record.getMessage(), record.getThrown());
		} else if (record.getLevel().intValue() >= Level.INFO.intValue()) {
			logger.info(record.getMessage(), record.getThrown());
		} else if (record.getLevel().intValue() >= Level.FINE.intValue()) {
			logger.debug(record.getMessage(), record.getThrown());
		} else {
			logger.trace(record.getMessage(), record.getThrown());
		}
		return null;
	} catch (Exception e) {
		sLogger.warn("Logging failed, reason: " + e.getMessage(), e);
	}
	return null;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:24,代码来源:UniTimeRemoteLoggingService.java

示例3: stepExecute

import org.apache.log4j.Logger; //导入方法依赖的package包/类
@Override
protected boolean stepExecute(Context javascriptContext, Scriptable scope) throws EngineException {
	if (isEnabled()) {
		if (super.stepExecute(javascriptContext, scope)) {
			Logger log = null;
			if(logger.equals(Engine.logEngine.getName())) 
				log = Engine.logEngine;
			else if(logger.equals(Engine.logContext.getName()))
				log = Engine.logContext;
			else if(logger.equals(Engine.logUser.getName()))
				log = Engine.logUser;
			else if(logger.equals(Engine.logAudit.getName())) 
				log = Engine.logAudit;
			if(level.equals(Level.WARN.toString()) && log.isEnabledFor(Level.WARN))
				log.warn(getEvalString(javascriptContext, scope));
			else if(level.equals(Level.INFO.toString()) && log.isInfoEnabled())
				log.info(getEvalString(javascriptContext, scope));
			else if(level.equals(Level.DEBUG.toString()) && log.isDebugEnabled())
				log.debug(getEvalString(javascriptContext, scope));
			else if(level.equals(Level.TRACE.toString()) && log.isTraceEnabled())
				log.trace(getEvalString(javascriptContext, scope));
			else if(level.equals(Level.ERROR.toString()) && log.isEnabledFor(Level.ERROR))
				log.error(getEvalString(javascriptContext, scope));
			return true;
		}
	}
	return false;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:29,代码来源:LogStep.java

示例4: publish

import org.apache.log4j.Logger; //导入方法依赖的package包/类
@Override
public void publish(LogRecord record)
{
	Logger logger = Logger.getLogger(record.getLoggerName());
	Level level = record.getLevel();
	String message = record.getMessage();
	try
	{
		message = MessageFormat.format(record.getMessage(), record.getParameters());
	}
	catch( IllegalArgumentException ignore )
	{
		// message will possibly have placeholder format for its
		// parameters, such as
		// "frog went {0} on a {1} day", "walking", "summer's",
		// If format fails, send message in the raw.
	}
	if( record.getThrown() != null && !Check.isEmpty(record.getThrown().getLocalizedMessage()) )
	{
		message += '\n' + record.getThrown().getLocalizedMessage();
	}

	if( Level.SEVERE.equals(level) )
	{
		logger.fatal(message);
	}
	else if( Level.INFO.equals(level) )
	{
		logger.info(message);
	}
	else if( Level.WARNING.equals(level) )
	{
		logger.warn(message);
	}
	else if( Level.FINE.equals(level) || Level.FINER.equals(level) || Level.FINEST.equals(level) )
	{
		logger.trace(record);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:40,代码来源:ReportingServiceImpl.java


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