Package org.slf4j

Examples of org.slf4j.Marker


    @Override
    public Marker getMarker(final String name) {
        if (name == null) {
            throw new IllegalArgumentException("Marker name must not be null");
        }
        Marker marker = markerMap.get(name);
        if (marker != null) {
            return marker;
        }
        marker = new MarkerWrapper(name);
        final Marker existing = markerMap.putIfAbsent(name, marker);
        return existing == null ? marker : existing;
    }
View Full Code Here


    private <T> void logOperationDetails(SessionOperation<T> opsthrows RepositoryException {
        if(operationLogger.isDebugEnabled()){
            String desc = ops.description();
            if(desc != null){
                Marker sessionMarker = MarkerFactory.getMarker(this.toString());
                operationLogger.debug(sessionMarker,desc);
            }
        }
    }
View Full Code Here

      } else {
        logger.error("This is an error message. Message number: " + i);
      }
    }

    Marker notifyAdmin = MarkerFactory.getMarker("NOTIFY_ADMIN");
    logger.error(notifyAdmin,
        "This is a serious an error requiring the admin's attention",
        new Exception("Just testing"));

    StatusPrinter.printInCaseOfErrorsOrWarnings(lc);
View Full Code Here

      if (i == 3)  {
        MDC.put("username", "sebastien");
        logger.debug("logging statement {}", i);
        MDC.remove("username");
      } else if (i == 6) {
        Marker billing = MarkerFactory.getMarker("billing");
        logger.error(billing, "billing statement {}", i);
      } else {
        logger.info("logging statement {}", i);
      }
    }
View Full Code Here

      if (i == 3)  {
        MDC.put("username", "sebastien");
        logger.debug("logging statement {}", i);
        MDC.remove("username");
      } else if (i == 6) {
        Marker billing = MarkerFactory.getMarker("billing");
        logger.error(billing, "billing statement {}", i);
      } else {
        logger.info("logging statement {}", i);
      }
    }
View Full Code Here

    //------------------------------------------------------------< internal >---

    private static <T> void logOperationDetails(ContentSession session, SessionOperation<T> ops) {
        if (operationLogger.isDebugEnabled()){
            Marker sessionMarker = MarkerFactory.getMarker(session.toString());
            String sessionId = session.toString();
            operationLogger.debug(sessionMarker, String.format("[%s] %s", sessionId, ops));
        }
    }
View Full Code Here

    //------------------------------------------------------------< internal >---

    private static <T> void logOperationDetails(ContentSession session, SessionOperation<T> ops) {
        if (operationLogger.isDebugEnabled()){
            Marker sessionMarker = MarkerFactory.getMarker(session.toString());
            String sessionId = session.toString();
            operationLogger.debug(sessionMarker, String.format("[%s] %s", sessionId, ops));
        }
    }
View Full Code Here

  public void format(final LoggingEvent event, final StringBuffer toAppendTo) {
   
    if(event instanceof FoundationLof4jLoggingEvent){
      FoundationLof4jLoggingEvent foundationLof4jLoggingEvent = (FoundationLof4jLoggingEvent)event;
     
      Marker marker = foundationLof4jLoggingEvent.getSlf4jMarker();
     
      marker.getName();
     
      if(marker instanceof FoundationLoggingMarker){
        FoundationLoggingMarker foundationLoggingMarker = (FoundationLoggingMarker)marker;
        String userFieldValue = foundationLoggingMarker.valueOf(key);
        if(FoundationLoggingMarker.NO_OPERATION.equals(userFieldValue)){
View Full Code Here

  public void format(LoggingEvent event, StringBuffer toAppendTo) {
    boolean appended = false;
    if (event instanceof FoundationLof4jLoggingEvent) { // So we can call get marker
      FoundationLof4jLoggingEvent foundationLof4jLoggingEvent = (FoundationLof4jLoggingEvent) event;

      Marker marker = foundationLof4jLoggingEvent.getSlf4jMarker();

      if (marker instanceof FoundationLoggingMarker) { // So this converter may
                            // uses internal pattern
                            // that is composed
                            // layout of %u{}
View Full Code Here

  private boolean udpateLayoutIfNeeded(Appender appender, LoggingEvent event) {

    if (event instanceof FoundationLof4jLoggingEvent) {

      FoundationLof4jLoggingEvent foundationLof4jLoggingEvent = (FoundationLof4jLoggingEvent) event;
      Marker marker = foundationLof4jLoggingEvent.getSlf4jMarker();

      if (marker != null) {

        Map<String, Layout> map = FoundationLogger.markerAppendersMap.get(marker.getName());

        if (map != null) {
          Layout specificPatternLayout = map.get(appender.getName());
          if (specificPatternLayout != null) {
            appender.setLayout(specificPatternLayout);
View Full Code Here

TOP

Related Classes of org.slf4j.Marker

Copyright © 2018 www.massapicom. 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.