code: public AbstractTracer getTracer(Thread thread) {
      this.poolReadLock.lock();
      try {
        AbstractTracer tracer;
        
        if (!this.tracerMap.containsKey(thread.getId())) {
          if (this.threadNames.contains(thread.getName())) { // non-unique thread name, first come first serve
            System.err.printf("WARNING: Duplicate thread name \"%s\" encountered.%n", thread.getName());
            tracer = this.defaultTracer;
          }
          else {
            if (this.threadName2Element.containsKey(thread.getName())) {
              try {
                Element threadElement = this.threadName2Element.get(thread.getName());
                String referencedTracerName = (String) this.xpath.evaluate("./dns:TraceLogger/@ref", threadElement, XPathConstants.STRING);
                tracer = getTracerByName(referencedTracerName);
                this.tracerMap.put(thread.getId(), tracer);
                this.threadNames.add(thread.getName());
              }
              catch (XPathExpressionException | TracerFactory.Exception ex) {
                tracer = this.defaultTracer;
              }
            }
            else
              tracer = this.defaultTracer;
          }
        }
        else
          tracer = this.tracerMap.get(thread.getId());
        
        return tracer;
      }
      finally {
        this.poolReadLock.unlock();
      }
    }
docs: Returns the mapped tracer for the given thread. The given Thread object is used as key to a map. If no tracer can be found within the map
  for the given Thread the configuration will be searched for the thread's name. That is initially the resolution is based on thread names (prior to program
  execution no threads do exist but someone may know the to be used thread names). If there isn't an entry for a given Thread but the name of the
  thread has been encountered before (thread names aren't unique) a NullTracer will be returned.
  @param thread the thread for which a tracer is searched
  @return the mapped tracer for the given thread