本文整理匯總了Java中com.evolveum.midpoint.util.logging.Trace.error方法的典型用法代碼示例。如果您正苦於以下問題:Java Trace.error方法的具體用法?Java Trace.error怎麽用?Java Trace.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.evolveum.midpoint.util.logging.Trace
的用法示例。
在下文中一共展示了Trace.error方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: recordFatalError
import com.evolveum.midpoint.util.logging.Trace; //導入方法依賴的package包/類
public static void recordFatalError(Trace logger, OperationResult opResult, String message, Throwable ex) {
if (message == null) {
message = ex.getMessage();
}
logger.error(message, ex);
opResult.recordFatalError(message, ex);
opResult.cleanupResult(ex);
}
示例2: log
import com.evolveum.midpoint.util.logging.Trace; //導入方法依賴的package包/類
@Override
public void log(Class<?> clazz, String method, Level level, String message, Throwable ex) {
Trace LOGGER = TraceManager.getTrace(clazz);
//Mark all messages from ICF as ICF
Marker m = MarkerFactory.getMarker("ICF");
//Translate ICF logging into slf4j
// OK -> trace
// INFO -> debug
// WARN -> warn
// ERROR -> error
if (Level.OK.equals(level)) {
if (null == ex) {
LOGGER.trace(m, "method: {} msg:{}", method, message);
} else {
LOGGER.trace(m, "method: {} msg:{}", new Object[] { method, message }, ex);
}
} else if (Level.INFO.equals(level)) {
if (null == ex) {
LOGGER.debug(m, "method: {} msg:{}", method, message);
} else {
LOGGER.debug(m, "method: {} msg:{}", new Object[] { method, message }, ex);
}
} else if (Level.WARN.equals(level)) {
if (null == ex) {
LOGGER.warn(m, "method: {} msg:{}", method, message);
} else {
LOGGER.warn(m, "method: {} msg:{}", new Object[] { method, message }, ex);
}
} else if (Level.ERROR.equals(level)) {
if (null == ex) {
LOGGER.error(m, "method: {} msg:{}", method, message);
} else {
LOGGER.error(m, "method: {} msg:{}", new Object[] { method, message }, ex);
}
}
}
示例3: logAllLevels
import com.evolveum.midpoint.util.logging.Trace; //導入方法依賴的package包/類
private void logAllLevels(Trace logger, String subsystemName) {
String message = MARKER+" "+subsystemName;
String previousSubsystem = MidpointInterceptor.swapSubsystemMark(subsystemName);
logger.trace(message);
logger.debug(message);
logger.info(message);
logger.warn(message);
logger.error(message);
MidpointInterceptor.swapSubsystemMark(previousSubsystem);
}
示例4: exit
import com.evolveum.midpoint.util.logging.Trace; //導入方法依賴的package包/類
public static <T extends AbstractCache> T exit(ThreadLocal<T> cacheThreadLocal, Trace logger) {
T inst = cacheThreadLocal.get();
logger.trace("Cache: EXIT for thread {}, {}", Thread.currentThread().getName(), inst);
if (inst == null || inst.getEntryCount() == 0) {
logger.error("Cache: Attempt to exit cache that does not exist or has entry count 0: {}", inst);
cacheThreadLocal.set(null);
} else {
inst.decrementEntryCount();
if (inst.getEntryCount() <= 0) {
destroy(cacheThreadLocal, logger);
}
}
return inst;
}
示例5: serializeFaultMessage
import com.evolveum.midpoint.util.logging.Trace; //導入方法依賴的package包/類
public static void serializeFaultMessage(Detail detail, FaultMessage faultMessage, PrismContext prismContext, Trace logger) {
try {
BeanMarshaller marshaller = ((PrismContextImpl) prismContext).getBeanMarshaller();
XNode faultMessageXnode = marshaller.marshall(faultMessage.getFaultInfo()); // TODO
RootXNode xroot = new RootXNode(SchemaConstants.FAULT_MESSAGE_ELEMENT_NAME, faultMessageXnode);
xroot.setExplicitTypeDeclaration(true);
QName faultType = prismContext.getSchemaRegistry().determineTypeForClass(faultMessage.getFaultInfo().getClass());
xroot.setTypeQName(faultType);
((PrismContextImpl) prismContext).getParserDom().serializeUnderElement(xroot, SchemaConstants.FAULT_MESSAGE_ELEMENT_NAME, detail);
} catch (SchemaException e) {
logger.error("Error serializing fault message (SOAP fault detail): {}", e.getMessage(), e);
}
}
示例6: logWarning
import com.evolveum.midpoint.util.logging.Trace; //導入方法依賴的package包/類
public static void logWarning(Trace logger, OperationResult opResult, String message, Exception ex) {
logger.error(message, ex);
opResult.recordWarning(message, ex);
}