Uploaded image for project: 'Logging analytics'
  1. Logging analytics
  2. LOG-115 Logging RI - SLF4J
  3. LOG-552

Handle EMPTY_STRING for serviceName MDC as well as a null value

XMLWordPrintable

    • LOG Sprint 8, LOG Sprint 11

      an empty ServiceName will not get set properly on the MDC map unless it is null - adding an empty string check

      get() returned	"" (id=201)	
      key	"ServiceName" (id=340)	
      Daemon Thread [http-nio-8080-exec-12] (Suspended)	
      	owns: NioEndpoint$NioSocketWrapper  (id=113)	
      	MDC.get(String) line: 203	
      	ONAPLogAdapter.setEnteringMDCs(RequestAdapter<?>) line: 336	
      	ONAPLogAdapter.entering(ONAPLogAdapter$RequestAdapter) line: 156	
      	ApplicationService.health(HttpServletRequest) line: 38	
      	RestHealthServiceImpl.getHealth() line: 47	
      
              if (MDC.get(ONAPLogConstants.MDCs.SERVICE_NAME) == null) {
                  MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
      to
              if (MDC.get(ONAPLogConstants.MDCs.SERVICE_NAME) == null ||
                      MDC.get(ONAPLogConstants.MDCs.SERVICE_NAME).equalsIgnoreCase(EMPTY_MESSAGE)) {
      
      testing change
      
      key	"ServiceName" (id=149)	
      val	"/logging-demo/rest/health/health" (id=153)
      
      MDC.put(String, String) line: 141	
      ONAPLogAdapter.setEnteringMDCs(RequestAdapter<?>) line: 338	
      ONAPLogAdapter.entering(ONAPLogAdapter$RequestAdapter) line: 156	
      ApplicationService.health(HttpServletRequest) line: 38	
      RestHealthServiceImpl.getHealth() line: 47		
      

            pau2882 pau2882
            michaelobrien michaelobrien
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: