com.evolveum.midpoint.util.logging.Trace类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中com.evolveum.midpoint.util.logging.Trace类的一些代码示例,展示了Trace类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Trace类的具体详情如下:
包路径:com.evolveum.midpoint.util.logging.Trace
类名称:Trace

Trace介绍

[英]Just am empty extension of SLF4J logger. This is supposed to be used for future extensions.
[中]我只是SLF4J记录器的空扩展。这应该用于未来的扩展。

代码示例

代码示例来源:origin: Evolveum/midpoint

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);
}

代码示例来源:origin: Evolveum/midpoint

private <F extends FocusType> void traceObjectSynchronization(SynchronizationContext<F> syncCtx) {
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("SYNCHRONIZATION determined policy: {}", syncCtx);
  }
}

代码示例来源:origin: Evolveum/midpoint

@Override
public void recordState(String message) {
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("{}", message);
  }
  if (PERFORMANCE_ADVISOR.isDebugEnabled()) {
    PERFORMANCE_ADVISOR.debug("{}", message);
  }
  environmentalPerformanceInformation.recordState(message);
}

代码示例来源:origin: Evolveum/midpoint

public static void logSecurityDeny(MidPointPrincipal midPointPrincipal, Object object, String message) {
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("Denied access to {} by {} {}", object, midPointPrincipal, message);
  }
}

代码示例来源:origin: Evolveum/midpoint

private void logFailDump() {
  LOGGER.debug("types:\n{}", diffMap(baselineTypeMap, typeMap));
  LOGGER.debug("misc:\n{}", diffMap(baselineMiscMap, miscMap));
  LOGGER.debug("nodes:\n{}", diffNodeMap());
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("LSOF output:\n{}", lsofOutput);
  }
}

代码示例来源:origin: Evolveum/midpoint

private void logAndShowStopBanner(String additionalMessage) {
    String message = "\n\n*******************************************************************************" +
        "\n***                                                                         ***" +
        "\n***       Couldn't start midPoint because of a database schema issue.       ***" +
        "\n***                                                                         ***" +
        "\n*******************************************************************************\n" +
        (additionalMessage != null ? "\n" + additionalMessage + "\n\n" : "");
    LOGGER.error("{}", message);
    System.err.println(message);
  }
}

代码示例来源:origin: Evolveum/midpoint

private void trace(String msg) {
  if (expressionType != null && expressionType.isTrace() == Boolean.TRUE) {
    LOGGER.info(msg);
  } else {
    LOGGER.trace(msg);
  }
}

代码示例来源:origin: Evolveum/midpoint

protected void logAttempt(String action, Class<?> type, String desc) {
  String msg = LOG_PREFIX_ATTEMPT+"Trying "+action+" of "+type.getSimpleName()+":"+desc;
  System.out.println(msg);
  LOGGER.info(msg);
}

代码示例来源:origin: Evolveum/midpoint

public void resetOverride() {
  LOGGER.info("Clock override reset");
  this.override = null;
  this.overrideOffset = null;
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("Clock current time: {}", currentTimeXMLGregorianCalendar());
  }
}

代码示例来源:origin: Evolveum/midpoint

public PrismObject<SystemConfigurationType> getSystemConfiguration(OperationResult result) throws ObjectNotFoundException, SchemaException {
  PrismObject<SystemConfigurationType> config = cacheRepositoryService.getObject(SystemConfigurationType.class,
      SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, result);
  if (LOGGER.isTraceEnabled()) {
    if (config == null) {
      LOGGER.warn("No system configuration object");
    } else {
      LOGGER.trace("System configuration version read from repo: " + config.getVersion());
    }
  }
  return config;
}

代码示例来源:origin: Evolveum/midpoint

@Override
public boolean matchRegex(String a, String regex) {
  LOGGER.warn("Regular expression matching is not supported for XML data types");
  return false;
}

代码示例来源:origin: Evolveum/midpoint

private void print(String header, SAXParseException e) {
  StringBuilder builder = new StringBuilder();
  builder.append("Error occured during schema parsing: ");
  builder.append(header);
  builder.append(" ");
  builder.append(MessageFormat.format("on line {0} at {1}, {2}",
      new Object[] { Integer.toString(e.getLineNumber()), e.getSystemId(), e.getPublicId() }));
  builder.append(" ");
  builder.append(e.getMessage());
  LOGGER.error(builder.toString());
  LOGGER.trace(builder.toString(), e);
}

代码示例来源:origin: Evolveum/midpoint

@Override
  public void timeout() {
    try {
      Task freshTask = taskManager.getTaskWithResult(taskOid, waitResult);
      OperationResult result = freshTask.getResult();
      LOGGER.debug("Result of timed-out task:\n{}", result.debugDump());
      assert false : "Timeout ("+timeout+") while waiting for "+freshTask+" to start. Last result "+result;
    } catch (ObjectNotFoundException | SchemaException e) {
      LOGGER.error("Exception during task refresh: {}", e, e);
    }
  }
};

代码示例来源:origin: Evolveum/midpoint

private synchronized void checkBlockOperations() {
  if (blockOperations) {
    try {
      LOGGER.info("Thread {} blocked", Thread.currentThread().getName());
      this.wait();
      LOGGER.info("Thread {} unblocked", Thread.currentThread().getName());
    } catch (InterruptedException e) {
      LOGGER.debug("Wait interrupted", e);
    }
  }
}

代码示例来源:origin: Evolveum/midpoint

public SchemaDescription loadPrismSchemaFileDescription(File file) throws FileNotFoundException, SchemaException {
  if (!(file.getName().matches(".*\\.xsd$"))){
    LOGGER.trace("Skipping registering {}, because it is not schema definition.", file.getAbsolutePath());
    return null;
  }
  LOGGER.debug("Loading schema from file {}", file);
  SchemaDescription desc = SchemaDescriptionImpl.parseFile(file);
  desc.setPrismSchema(true);
  registerSchemaDescription(desc);
  return desc;
}

代码示例来源:origin: Evolveum/midpoint

public static void displayPrismValuesCollection(String message, Collection<? extends PrismValue> collection) {
  System.out.println(OBJECT_TITLE_OUT_PREFIX + message);
  LOGGER.debug(OBJECT_TITLE_LOG_PREFIX + message);
  for (PrismValue v : collection) {
    System.out.println(DebugUtil.debugDump(v));
    LOGGER.debug("{}", DebugUtil.debugDump(v));
    System.out.println(OBJECT_LIST_SEPARATOR);
    LOGGER.debug(OBJECT_LIST_SEPARATOR);
  }
}

代码示例来源:origin: Evolveum/midpoint

private void processInterruption(TaskRunResult runResult, PrismObject<ResourceType> resource, Task task, OperationResult opResult) {
  opResult.recordWarning("Interrupted");
  if (LOGGER.isWarnEnabled()) {
    LOGGER.warn("Reconciliation on {} interrupted", resource);
  }
  runResult.setRunResultStatus(TaskRunResultStatus.INTERRUPTED);          // not strictly necessary, because using task.canRun() == false the task manager knows we were interrupted
  TaskHandlerUtil.appendLastFailuresInformation(OperationConstants.RECONCILIATION, task, opResult);    // TODO implement more seriously
}

代码示例来源:origin: Evolveum/midpoint

private void logOperationInformation(ModelContext context) {
  if (LOGGER.isTraceEnabled()) {
    @SuppressWarnings({"unchecked", "raw"})
    LensContext<?> lensContext = (LensContext<?>) context;
    try {
      medic.traceContext(LOGGER, "WORKFLOW (" + context.getState() + ")", "workflow processing", true, lensContext, false);
    } catch (SchemaException e) {
      throw new IllegalStateException("SchemaException when tracing model context: " + e.getMessage(), e);
    }
  }
}

代码示例来源:origin: Evolveum/midpoint

public static void processRuleWithException(@NotNull EvaluatedPolicyRule rule, Collection<EvaluatedPolicyRuleTrigger <?>> triggers,
     PolicyExceptionType policyException) {
  LOGGER.debug("Policy rule {} would be triggered, but there is an exception for it. Not triggering", rule.getName());
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("Policy rule {} would be triggered, but there is an exception for it:\nTriggers:\n{}\nException:\n{}",
        rule.getName(), DebugUtil.debugDump(triggers, 1), policyException);
  }
  ((EvaluatedPolicyRuleImpl)rule).addPolicyException(policyException);
}

代码示例来源:origin: Evolveum/midpoint

private void createDir(String dir) {
    File d = new File(dir);
    if (!d.exists() || !d.isDirectory()) {
      boolean created = d.mkdirs();
      if (!created) {
        LOGGER.error("Unable to create directory " + dir + " as user " + System.getProperty("user.name"));
      }
    }
  }
}

相关文章