code: public void setWsLogHandler(String id, WsLogHandler ref) {
          if (id != null && ref != null) {
              //There can be many Reader locks, but only one writer lock.
              //This ReaderWriter lock is needed to avoid duplicate messages when the class is passing on EarlyBuffer messages to the new WsLogHandler.
              RERWLOCK.writeLock().lock();
              try {
                  wsLogHandlerServices.put(id, ref);
                  /*
                   * Route prev messages to the new LogHandler.
                   *
                   * This is primarily for solving the problem during server init where the WsMessageRouterImpl
                   * is registered *after* we've already issued some early startup messages. We cache
                   * these early messages in the "earlierMessages" queue in BaseTraceService, which then
                   * passes them to WsMessageRouterImpl once it's registered.
                   */
                  if (earlierMessages == null) {
                      return;
                  }
  
                  for (RoutedMessage earlierMessage : earlierMessages.toArray(new RoutedMessage[earlierMessages.size()])) {
                      if (shouldRouteMessageToLogHandler(earlierMessage, id)) {
                          routeTo(earlierMessage, id);
                      }
                  }
              } finally {
                  RERWLOCK.writeLock().unlock();
              }
  
          }
      }
docs: Add the WsLogHandler ref. 1 or more LogHandlers may be set.