Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9585

Solr gc log filename should include port number

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      In our setup, we have two solr applications running on the same box on different ports. We are sharing the same distribution folder However, both instances log garbage collection to the same file, as shown by these two parts from the solr bash shell script (this is from master):

      if [ -f "$SOLR_LOGS_DIR/solr_gc.log" ]; then
        if $verbose ; then
          echo "Backing up $SOLR_LOGS_DIR/solr_gc.log"
        fi
        mv "$SOLR_LOGS_DIR/solr_gc.log" "$SOLR_LOGS_DIR/solr_gc_log_$(date +"%Y%m%d_%H%M")"
      fi
      
      # if verbose gc logging enabled, setup the location of the log file
      if [ "$GC_LOG_OPTS" != "" ]; then
        gc_log_flag="-Xloggc"
        if [ "$JAVA_VENDOR" == "IBM J9" ]; then
          gc_log_flag="-Xverbosegclog"
        fi
        GC_LOG_OPTS=($GC_LOG_OPTS "$gc_log_flag:$SOLR_LOGS_DIR/solr_gc.log")
      else
        GC_LOG_OPTS=()
      fi
      

      I'm proposing appending the $SOLR_PORT value into the log file name (perhaps only if non-default) so we can have both logs in our case. I'm happy to provide a patch assuming this direction is desired.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mbraun688 Michael Braun
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: