org.jboss.logging.Logger.tracef()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(181)

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

Logger.tracef介绍

[英]Issue a formatted log message with a level of TRACE.
[中]发出具有跟踪级别的格式化日志消息。

代码示例

代码示例来源:origin: wildfly/wildfly

void executorUntick(Object opened) {
  // just like resourceUntick - except we allow tasks to be submitted after close begins.
  int old;
  do {
    old = resourceCountUpdater.get(this);
    if (old == CLOSED_FLAG) {
      throw new RejectedExecutionException("Endpoint is not open");
    }
  } while (! resourceCountUpdater.compareAndSet(this, old, old + 1));
  if (log.isTraceEnabled()) {
    log.tracef("Allocated tick to %d of %s (opened %s)", Integer.valueOf(old + 1), this, opened);
  }
}

代码示例来源:origin: hibernate/hibernate-orm

private static void dump(Document document) {
    if ( !log.isTraceEnabled() ) {
      return;
    }

    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final Writer w = new PrintWriter( baos );

    try {
      final XMLWriter xw = new XMLWriter( w, new OutputFormat( " ", true ) );
      xw.write( document );
      w.flush();
    }
    catch (IOException e1) {
      throw new RuntimeException( "Error dumping enhanced class", e1 );
    }

    log.tracef( "Envers-generate entity mapping -----------------------------\n%s", baos.toString() );
    log.trace( "------------------------------------------------------------" );
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public boolean generateSchema(String persistenceUnitName, Map map) {
  log.tracef( "Starting generateSchema for persistenceUnitName %s", persistenceUnitName );
  final EntityManagerFactoryBuilder builder = getEntityManagerFactoryBuilderOrNull( persistenceUnitName, map );
  if ( builder == null ) {
    log.trace( "Could not obtain matching EntityManagerFactoryBuilder, returning false" );
    return false;
  }
  builder.generateSchema();
  return true;
}

代码示例来源:origin: wildfly/wildfly

public void handleMessage(Channel channel, MessageInputStream messageInputStream) {
  DataInputStream dis = new DataInputStream(messageInputStream);
  try {
    log.tracef("Bytes Available %d", dis.available());
    byte[] firstThree = new byte[3];
    dis.read(firstThree);
    log.tracef("First Three %s", new String(firstThree));
    if (Arrays.equals(firstThree, "JMX".getBytes()) == false) {
      throw new IOException("Invalid leading bytes in header.");
    }
    log.tracef("Bytes Available %d", dis.available());
    String connectionId = dis.readUTF();
    future.setResult(connectionId);
  } catch (IOException e) {
    future.setException(e);
  } finally {
    IoUtils.safeClose(dis);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public void handle(DataInput input, int correlationId) throws IOException {
  log.trace("GetMBeanInfo");
  byte paramType = input.readByte();
  if (paramType != OBJECT_NAME) {
    throw new IOException("Unexpected paramType");
  }
  Unmarshaller unmarshaller = prepareForUnMarshalling(input);
  ObjectName objectName;
  try {
    objectName = unmarshaller.readObject(ObjectName.class);
  } catch (ClassNotFoundException cnfe) {
    throw new IOException(cnfe);
  }
  try {
    MBeanInfo info = server.getMBeanServerConnection().getMBeanInfo(objectName);
    writeResponse(info, MBEAN_INFO, GET_MBEAN_INFO, correlationId);
    log.tracef("[%d] GetMBeanInfo - Success Response Sent", correlationId);
  } catch (IntrospectionException e) {
    writeResponse(e, MBEAN_INFO, correlationId);
    log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId);
  } catch (InstanceNotFoundException e) {
    writeResponse(e, MBEAN_INFO, correlationId);
    log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId);
  } catch (ReflectionException e) {
    writeResponse(e, MBEAN_INFO, correlationId);
    log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId);
  }
}

代码示例来源:origin: hibernate/hibernate-orm

if ( LimitHelper.hasMaxRows( selection ) ) {
  maxRows = selection.getMaxRows();
  LOG.tracef( "Limiting ResultSet processing to just %s rows", maxRows );
LOG.trace( "Processing result set" );
int count;
for ( count = 0; count < maxRows && resultSet.next(); count++ ) {

代码示例来源:origin: wildfly/wildfly

public void handleMessage(Channel channel, MessageInputStream messageInputStream) {
  DataInputStream dis = new DataInputStream(messageInputStream);
  try {
    log.tracef("Bytes Available %d", dis.available());
    byte[] firstThree = new byte[3];
    dis.read(firstThree);
    log.tracef("First Three %s", new String(firstThree));
    if (Arrays.equals(firstThree, "JMX".getBytes()) == false) {
      throw new IOException("Invalid leading bytes in header.");
    }
    future.setResult(null);
  } catch (IOException e) {
    future.setException(e);
  } finally {
    IoUtils.safeClose(dis);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public void handle(DataInput input, int correlationId) throws IOException {
  log.trace("UnregisterMBean");
  byte paramType = input.readByte();
  if (paramType != OBJECT_NAME) {
    throw new IOException("Unexpected paramType");
  }
  Unmarshaller unmarshaller = prepareForUnMarshalling(input);
  ObjectName objectName;
  try {
    objectName = unmarshaller.readObject(ObjectName.class);
  } catch (ClassNotFoundException cnfe) {
    throw new IOException(cnfe);
  }
  try {
    server.getMBeanServerConnection().unregisterMBean(objectName);
    writeResponse(UNREGISTER_MBEAN, correlationId);
    log.tracef("[%d] UnregisterMBean - Success Response Sent", correlationId);
  } catch (MBeanRegistrationException e) {
    writeResponse(e, UNREGISTER_MBEAN, correlationId);
    log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId);
  } catch (InstanceNotFoundException e) {
    writeResponse(e, UNREGISTER_MBEAN, correlationId);
    log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId);
  }
}

代码示例来源:origin: wildfly/wildfly

void resourceUntick(Object opened) throws NotOpenException {
  int old;
  do {
    old = resourceCountUpdater.get(this);
    if ((old & CLOSED_FLAG) != 0) {
      throw new NotOpenException("Endpoint is not open");
    }
  } while (! resourceCountUpdater.compareAndSet(this, old, old + 1));
  if (log.isTraceEnabled()) {
    log.tracef("Allocated tick to %d of %s (opened %s)", Integer.valueOf(old + 1), this, opened);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public void handle(DataInput input, final int correlationId) throws IOException {
  log.trace("GetDomains");
  final String[] domains = server.getMBeanServerConnection().getDomains();
  writeResponse(domains, GET_DOMAINS, correlationId);
  log.tracef("[%d] GetDomains - Success Response Sent", correlationId);
}

代码示例来源:origin: hibernate/hibernate-orm

LOG.tracef( "Beginning parsing of order-by fragment : " + fragment );
if ( LOG.isTraceEnabled() ) {
  LOG.trace( TokenPrinters.ORDERBY_FRAGMENT_PRINTER.showAsString( parser.getAST(), "--- {order-by fragment} ---" ) );

代码示例来源:origin: wildfly/wildfly

byte messageId = dis.readByte();
final int correlationId = dis.readInt();
log.tracef("Message Received id(%h), correlationId(%d)", messageId, correlationId);
  throw new IOException("Unrecognised Message ID");

代码示例来源:origin: wildfly/wildfly

@Override
public void handle(DataInput input, final int correlationId) throws IOException {
  log.trace("GetAttribute");
    throw new IOException("Unexpected paramType");
    objectName = unmarshaller.readObject(ObjectName.class);
  } catch (ClassNotFoundException cnfe) {
    throw new IOException(cnfe);
    throw new IOException("Unexpected paramType");
    log.tracef("[%d] GetAttribute - Success Response Sent", correlationId);
  } catch (AttributeNotFoundException e) {
    writeResponse(e, GET_ATTRIBUTE, correlationId);
    log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
  } catch (InstanceNotFoundException e) {
    writeResponse(e, GET_ATTRIBUTE, correlationId);
    log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
  } catch (MBeanException e) {
    writeResponse(e, GET_ATTRIBUTE, correlationId);
    log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
  } catch (ReflectionException e) {
    writeResponse(e, GET_ATTRIBUTE, correlationId);
    log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);

代码示例来源:origin: wildfly/wildfly

@Override
public void removeSingleSignOn(SingleSignOn sso) {
  if(log.isTraceEnabled()) {
    log.tracef("Removing SSO ID %s.", sso.getId());
  }
  this.ssoEntries.remove(sso.getId());
}

代码示例来源:origin: wildfly/wildfly

@Override
  public void handle(DataInput input, final int correlationId) throws IOException {
    log.trace("GetDefaultDomain");
    final String defaultDomain = server.getMBeanServerConnection().getDefaultDomain();
    writeResponse(defaultDomain, GET_DEFAULT_DOMAIN, correlationId);
    log.tracef("[%d] CreateMBean - Success Response Sent", correlationId);
  }
}

代码示例来源:origin: hibernate/hibernate-orm

if ( LOG.isTraceEnabled() ) {
    LOG.trace(
        "Resolved natural key -> primary key resolution in session cache: " +
            persister.getRootEntityName() + "#[" +
if ( LOG.isTraceEnabled() ) {
  LOG.tracef(
      "Found natural key [%s] -> primary key [%s] xref in second-level cache for %s",
      Arrays.toString( naturalIdValues ),

代码示例来源:origin: wildfly/wildfly

public Integer getMBeanCount() throws IOException {
  VersionedIoFuture<TypeExceptionHolder<Integer>> future = new VersionedIoFuture<TypeExceptionHolder<Integer>>();
  final int correlationId = reserveNextCorrelationId(future);
  try {
    write(new MessageWriter() {
      @Override
      public void write(DataOutput output) throws IOException {
        output.writeByte(GET_MBEAN_COUNT);
        output.writeInt(correlationId);
      }
    });
    log.tracef("[%d] getMBeanCount - Request Sent", correlationId);
    IoFuture.Status result = future.await(timeoutSeconds, TimeUnit.SECONDS);
    switch (result) {
      case DONE:
        TypeExceptionHolder<Integer> response = future.get();
        if (response.e == null) {
          return response.value;
        }
        jmRuntimeException(response.e);
        throw toIoException(response.e);
      case FAILED:
        throw future.getException();
      default:
        throw new IOException("Unable to obtain MBeanCount, status=" + result.toString());
    }
  } finally {
    releaseCorrelationId(correlationId);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public void handle(DataInput input, int correlationId) throws IOException {
  log.trace("GetObjectInstance");
  byte paramType = input.readByte();
  if (paramType != OBJECT_NAME) {
    throw new IOException("Unexpected paramType");
  }
  Unmarshaller unmarshaller = prepareForUnMarshalling(input);
  ObjectName objectName;
  try {
    objectName = unmarshaller.readObject(ObjectName.class);
  } catch (ClassNotFoundException cnfe) {
    throw new IOException(cnfe);
  }
  try {
    ObjectInstance objectInstance = server.getMBeanServerConnection().getObjectInstance(objectName);
    writeResponse(objectInstance, OBJECT_INSTANCE, GET_OBJECT_INSTANCE, correlationId);
    log.tracef("[%d] GetObjectInstance - Success Response Sent", correlationId);
  } catch (InstanceNotFoundException e) {
    writeResponse(e, GET_OBJECT_INSTANCE, correlationId);
    log.tracef("[%d] GetObjectInstance - Failure Response Sent", correlationId);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public SingleSignOn createSingleSignOn(Account account, String mechanism) {
  String id = SECURE_RANDOM_SESSION_ID_GENERATOR.createSessionId();
  SingleSignOn entry = new SimpleSingleSignOnEntry(id, account, mechanism);
  this.ssoEntries.put(id, entry);
  if(log.isTraceEnabled()) {
    log.tracef("Creating SSO ID %s for Principal %s and Roles %s.", id, account.getPrincipal().getName(), account.getRoles().toString());
  }
  return entry;
}

代码示例来源:origin: wildfly/wildfly

@Override
public void handle(DataInput input, final int correlationId) throws IOException {
  log.trace("GetDomains");
  final String[] domains = server.getMBeanServerConnection().getDomains();
  writeResponse(domains, GET_DOMAINS, correlationId);
  log.tracef("[%d] GetDomains - Success Response Sent", correlationId);
}

相关文章