Package org.slf4j

Examples of org.slf4j.Logger.trace()


    Logger logger = getLogger();
    ResourceBundle bundle = getBundle();
   
    if (!getContexts().contains(context)){
      getContexts().add(context);
      logger.trace( bundle.getString("bootstrap-context-added", context.getClass().getCanonicalName() , context.getScope().getSimpleName() ) );
    }
    else{
      logger.warn( bundle.getString("bootstrap-context-already-managed", context.getClass().getCanonicalName() , context.getScope().getSimpleName() ) );
    }
  }
View Full Code Here


            // Get the start of the current period
            final Time startOfPeriod = Time.now();

            if (log.isTraceEnabled())
            {
              log.trace("Run the job: " + code.toString());
            }

            try
            {
              // Run the user's code
View Full Code Here

              log.error("Unhandled exception thrown by user code in task " + name, e);
            }

            if (log.isTraceEnabled())
            {
              log.trace("Finished with job: " + code.toString());
            }

            // Sleep until the period is over (or not at all if it's
            // already passed)
            startOfPeriod.add(frequency).fromNow().sleep();
View Full Code Here

public class LoggingTest {
  @Test
  public void log() {
    Logger log = LoggerFactory.getLogger(LoggingTest.class);
   
    log.trace("This is a TRACE log message");
    log.debug("This is a DEBUG log message");
    log.info("This is a INFO log message");
    log.warn("This is a WARN log message");
    log.error("This is a ERROR log message");
  }
View Full Code Here

    public void tracing(ResultSet resultSet) {
        if (isTracingEnabled()) {
            Logger actualLogger = traceQueryForEntity ? entityLogger : dmlLogger;
            for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) {

                actualLogger.trace("Query tracing at host {} with achieved consistency level {} ", executionInfo.getQueriedHost(), executionInfo.getAchievedConsistencyLevel());
                actualLogger.trace("****************************");
                if (actualLogger.isTraceEnabled()) {
                    actualLogger.trace(String.format("%1$-80s | %2$-16s | %3$-24s | %4$-20s", "Description", "Source", "Source elapsed in micros", "Thread name"));
                }
                try {
View Full Code Here

        if (isTracingEnabled()) {
            Logger actualLogger = traceQueryForEntity ? entityLogger : dmlLogger;
            for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) {

                actualLogger.trace("Query tracing at host {} with achieved consistency level {} ", executionInfo.getQueriedHost(), executionInfo.getAchievedConsistencyLevel());
                actualLogger.trace("****************************");
                if (actualLogger.isTraceEnabled()) {
                    actualLogger.trace(String.format("%1$-80s | %2$-16s | %3$-24s | %4$-20s", "Description", "Source", "Source elapsed in micros", "Thread name"));
                }
                try {
                    final QueryTrace queryTrace = executionInfo.getQueryTrace();
View Full Code Here

            for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) {

                actualLogger.trace("Query tracing at host {} with achieved consistency level {} ", executionInfo.getQueriedHost(), executionInfo.getAchievedConsistencyLevel());
                actualLogger.trace("****************************");
                if (actualLogger.isTraceEnabled()) {
                    actualLogger.trace(String.format("%1$-80s | %2$-16s | %3$-24s | %4$-20s", "Description", "Source", "Source elapsed in micros", "Thread name"));
                }
                try {
                    final QueryTrace queryTrace = executionInfo.getQueryTrace();
                    final List<QueryTrace.Event> events = new ArrayList<>(queryTrace.getEvents());
                    Collections.sort(events, EVENT_TRACE_COMPARATOR);
View Full Code Here

                    final QueryTrace queryTrace = executionInfo.getQueryTrace();
                    final List<QueryTrace.Event> events = new ArrayList<>(queryTrace.getEvents());
                    Collections.sort(events, EVENT_TRACE_COMPARATOR);
                    for (QueryTrace.Event event : events) {
                        final String formatted = String.format("%1$-80s | %2$-16s | %3$-24s | %4$-20s", event.getDescription(), event.getSource(), event.getSourceElapsedMicros(), event.getThreadName());
                        actualLogger.trace(formatted);
                    }
                } catch (TraceRetrievalException e) {
                    actualLogger.trace(" ERROR: cannot retrieve trace for query {} because it may not be yet available", getQueryString());
                }
                actualLogger.trace("****************************");
 
View Full Code Here

                    for (QueryTrace.Event event : events) {
                        final String formatted = String.format("%1$-80s | %2$-16s | %3$-24s | %4$-20s", event.getDescription(), event.getSource(), event.getSourceElapsedMicros(), event.getThreadName());
                        actualLogger.trace(formatted);
                    }
                } catch (TraceRetrievalException e) {
                    actualLogger.trace(" ERROR: cannot retrieve trace for query {} because it may not be yet available", getQueryString());
                }
                actualLogger.trace("****************************");
            }
        }
    }
View Full Code Here

                        actualLogger.trace(formatted);
                    }
                } catch (TraceRetrievalException e) {
                    actualLogger.trace(" ERROR: cannot retrieve trace for query {} because it may not be yet available", getQueryString());
                }
                actualLogger.trace("****************************");
            }
        }
    }

    private static class EventComparator implements Comparator<QueryTrace.Event> {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.