code: protected void publishTraceLogRecord(TraceWriter detailLog, LogRecord logRecord, Object id, String formattedMsg, String formattedVerboseMsg) {
          //check if tracefilename is stdout
          if (formattedVerboseMsg == null) {
              formattedVerboseMsg = formatter.formatVerboseMessage(logRecord, formattedMsg, false);
          }
          RoutedMessage routedTrace = new RoutedMessageImpl(formattedMsg, formattedVerboseMsg, null, logRecord);
  
          invokeTraceRouters(routedTrace);
  
          /*
           * Avoid any feedback traces that are emitted after this point.
           * The first time the counter increments is the first pass-through.
           * The second time the counter increments is the second pass-through due
           * to trace emitted. We do not want any more pass-throughs.
           */
          try {
              if (!(counterForTraceSource.incrementCount() > 2)) {
                  if (logRecord != null) {
                      Level level = logRecord.getLevel();
                      int levelValue = level.intValue();
                      if (levelValue < Level.INFO.intValue()) {
                          String levelName = level.getName();
                          if (!(levelName.equals("SystemOut") || levelName.equals("SystemErr"))) { //SystemOut/Err=700
                              if (traceSource != null) {
                                  traceSource.publish(routedTrace, id);
                              }
                          }
                      }
                  }
              }
          } finally {
              counterForTraceSource.decrementCount();
          }
  
          try {
              if (!(counterForTraceWriter.incrementCount() > 1)) {
                  // write to trace.log
                  if (detailLog != systemOut) {
                      String traceDetail = formatter.traceLogFormat(logRecord, id, formattedMsg, formattedVerboseMsg);
                      detailLog.writeRecord(traceDetail);
                  }
              }
          } finally {
              counterForTraceWriter.decrementCount();
          }
      }
docs: Publish a trace log record.
  
  @param detailLog the trace writer
  @param logRecord
  @param id the trace object id
  @param formattedMsg the result of {@link BaseTraceFormatter#formatMessage}
  @param formattedVerboseMsg the result of {@link BaseTraceFormatter#formatVerboseMessage}