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

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

本文整理了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

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

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

  1. private static void dump(Document document) {
  2. if ( !log.isTraceEnabled() ) {
  3. return;
  4. }
  5. final ByteArrayOutputStream baos = new ByteArrayOutputStream();
  6. final Writer w = new PrintWriter( baos );
  7. try {
  8. final XMLWriter xw = new XMLWriter( w, new OutputFormat( " ", true ) );
  9. xw.write( document );
  10. w.flush();
  11. }
  12. catch (IOException e1) {
  13. throw new RuntimeException( "Error dumping enhanced class", e1 );
  14. }
  15. log.tracef( "Envers-generate entity mapping -----------------------------\n%s", baos.toString() );
  16. log.trace( "------------------------------------------------------------" );
  17. }
  18. }

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

  1. @Override
  2. public boolean generateSchema(String persistenceUnitName, Map map) {
  3. log.tracef( "Starting generateSchema for persistenceUnitName %s", persistenceUnitName );
  4. final EntityManagerFactoryBuilder builder = getEntityManagerFactoryBuilderOrNull( persistenceUnitName, map );
  5. if ( builder == null ) {
  6. log.trace( "Could not obtain matching EntityManagerFactoryBuilder, returning false" );
  7. return false;
  8. }
  9. builder.generateSchema();
  10. return true;
  11. }

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

  1. public void handleMessage(Channel channel, MessageInputStream messageInputStream) {
  2. DataInputStream dis = new DataInputStream(messageInputStream);
  3. try {
  4. log.tracef("Bytes Available %d", dis.available());
  5. byte[] firstThree = new byte[3];
  6. dis.read(firstThree);
  7. log.tracef("First Three %s", new String(firstThree));
  8. if (Arrays.equals(firstThree, "JMX".getBytes()) == false) {
  9. throw new IOException("Invalid leading bytes in header.");
  10. }
  11. log.tracef("Bytes Available %d", dis.available());
  12. String connectionId = dis.readUTF();
  13. future.setResult(connectionId);
  14. } catch (IOException e) {
  15. future.setException(e);
  16. } finally {
  17. IoUtils.safeClose(dis);
  18. }
  19. }

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

  1. @Override
  2. public void handle(DataInput input, int correlationId) throws IOException {
  3. log.trace("GetMBeanInfo");
  4. byte paramType = input.readByte();
  5. if (paramType != OBJECT_NAME) {
  6. throw new IOException("Unexpected paramType");
  7. }
  8. Unmarshaller unmarshaller = prepareForUnMarshalling(input);
  9. ObjectName objectName;
  10. try {
  11. objectName = unmarshaller.readObject(ObjectName.class);
  12. } catch (ClassNotFoundException cnfe) {
  13. throw new IOException(cnfe);
  14. }
  15. try {
  16. MBeanInfo info = server.getMBeanServerConnection().getMBeanInfo(objectName);
  17. writeResponse(info, MBEAN_INFO, GET_MBEAN_INFO, correlationId);
  18. log.tracef("[%d] GetMBeanInfo - Success Response Sent", correlationId);
  19. } catch (IntrospectionException e) {
  20. writeResponse(e, MBEAN_INFO, correlationId);
  21. log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId);
  22. } catch (InstanceNotFoundException e) {
  23. writeResponse(e, MBEAN_INFO, correlationId);
  24. log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId);
  25. } catch (ReflectionException e) {
  26. writeResponse(e, MBEAN_INFO, correlationId);
  27. log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId);
  28. }
  29. }

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

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

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

  1. public void handleMessage(Channel channel, MessageInputStream messageInputStream) {
  2. DataInputStream dis = new DataInputStream(messageInputStream);
  3. try {
  4. log.tracef("Bytes Available %d", dis.available());
  5. byte[] firstThree = new byte[3];
  6. dis.read(firstThree);
  7. log.tracef("First Three %s", new String(firstThree));
  8. if (Arrays.equals(firstThree, "JMX".getBytes()) == false) {
  9. throw new IOException("Invalid leading bytes in header.");
  10. }
  11. future.setResult(null);
  12. } catch (IOException e) {
  13. future.setException(e);
  14. } finally {
  15. IoUtils.safeClose(dis);
  16. }
  17. }

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

  1. @Override
  2. public void handle(DataInput input, int correlationId) throws IOException {
  3. log.trace("UnregisterMBean");
  4. byte paramType = input.readByte();
  5. if (paramType != OBJECT_NAME) {
  6. throw new IOException("Unexpected paramType");
  7. }
  8. Unmarshaller unmarshaller = prepareForUnMarshalling(input);
  9. ObjectName objectName;
  10. try {
  11. objectName = unmarshaller.readObject(ObjectName.class);
  12. } catch (ClassNotFoundException cnfe) {
  13. throw new IOException(cnfe);
  14. }
  15. try {
  16. server.getMBeanServerConnection().unregisterMBean(objectName);
  17. writeResponse(UNREGISTER_MBEAN, correlationId);
  18. log.tracef("[%d] UnregisterMBean - Success Response Sent", correlationId);
  19. } catch (MBeanRegistrationException e) {
  20. writeResponse(e, UNREGISTER_MBEAN, correlationId);
  21. log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId);
  22. } catch (InstanceNotFoundException e) {
  23. writeResponse(e, UNREGISTER_MBEAN, correlationId);
  24. log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId);
  25. }
  26. }

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

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

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

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

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

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

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

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

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

  1. @Override
  2. public void handle(DataInput input, final int correlationId) throws IOException {
  3. log.trace("GetAttribute");
  4. throw new IOException("Unexpected paramType");
  5. objectName = unmarshaller.readObject(ObjectName.class);
  6. } catch (ClassNotFoundException cnfe) {
  7. throw new IOException(cnfe);
  8. throw new IOException("Unexpected paramType");
  9. log.tracef("[%d] GetAttribute - Success Response Sent", correlationId);
  10. } catch (AttributeNotFoundException e) {
  11. writeResponse(e, GET_ATTRIBUTE, correlationId);
  12. log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
  13. } catch (InstanceNotFoundException e) {
  14. writeResponse(e, GET_ATTRIBUTE, correlationId);
  15. log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
  16. } catch (MBeanException e) {
  17. writeResponse(e, GET_ATTRIBUTE, correlationId);
  18. log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
  19. } catch (ReflectionException e) {
  20. writeResponse(e, GET_ATTRIBUTE, correlationId);
  21. log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);

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

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

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

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

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

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

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

  1. public Integer getMBeanCount() throws IOException {
  2. VersionedIoFuture<TypeExceptionHolder<Integer>> future = new VersionedIoFuture<TypeExceptionHolder<Integer>>();
  3. final int correlationId = reserveNextCorrelationId(future);
  4. try {
  5. write(new MessageWriter() {
  6. @Override
  7. public void write(DataOutput output) throws IOException {
  8. output.writeByte(GET_MBEAN_COUNT);
  9. output.writeInt(correlationId);
  10. }
  11. });
  12. log.tracef("[%d] getMBeanCount - Request Sent", correlationId);
  13. IoFuture.Status result = future.await(timeoutSeconds, TimeUnit.SECONDS);
  14. switch (result) {
  15. case DONE:
  16. TypeExceptionHolder<Integer> response = future.get();
  17. if (response.e == null) {
  18. return response.value;
  19. }
  20. jmRuntimeException(response.e);
  21. throw toIoException(response.e);
  22. case FAILED:
  23. throw future.getException();
  24. default:
  25. throw new IOException("Unable to obtain MBeanCount, status=" + result.toString());
  26. }
  27. } finally {
  28. releaseCorrelationId(correlationId);
  29. }
  30. }

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

  1. @Override
  2. public void handle(DataInput input, int correlationId) throws IOException {
  3. log.trace("GetObjectInstance");
  4. byte paramType = input.readByte();
  5. if (paramType != OBJECT_NAME) {
  6. throw new IOException("Unexpected paramType");
  7. }
  8. Unmarshaller unmarshaller = prepareForUnMarshalling(input);
  9. ObjectName objectName;
  10. try {
  11. objectName = unmarshaller.readObject(ObjectName.class);
  12. } catch (ClassNotFoundException cnfe) {
  13. throw new IOException(cnfe);
  14. }
  15. try {
  16. ObjectInstance objectInstance = server.getMBeanServerConnection().getObjectInstance(objectName);
  17. writeResponse(objectInstance, OBJECT_INSTANCE, GET_OBJECT_INSTANCE, correlationId);
  18. log.tracef("[%d] GetObjectInstance - Success Response Sent", correlationId);
  19. } catch (InstanceNotFoundException e) {
  20. writeResponse(e, GET_OBJECT_INSTANCE, correlationId);
  21. log.tracef("[%d] GetObjectInstance - Failure Response Sent", correlationId);
  22. }
  23. }

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

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

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

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

相关文章