We couldn't load all Actvitity tabs. Refresh the page to try again.
If the problem persists, contact your Jira admin.
We are migrating this Jira service to Github. Issue creation is no longer possible on this server and must be done on Github. However, you may browse issues without an account. Editing or commenting on existing issues requires an account.

Please support SLF4J/logback/reload4j projects via Github donations and sponsorship.

Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-248

option to create new file on start of SizeAndTimeBasedFNATP

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • logback-core
    • None

    Description

      It would be nice to have the option of having the SizeAndTimeBasedFNATP always create a new file on a restart (only applicable when <File> is not specified – only the <FileNamePattern>). Currently, if a process locks the latest file while the appender is stopped, then the FileAppender.openFile will fail if the file is still locked when the appender starts again.

      I'm currently accomplishing this by overriding SizeAndTimeBasedFNATP.start and using reflection to increment the currentPeriodsCounter.

      If a boolean option (e.g. "newFileOnStart") was added to SizeAndTimeBasedFNATP and computeCurrentPeriodsHighestCounterValue was modified to return whether or not a matching file was found, then the start method could be modified as shown below:

      if (tbrp.getParentsRawFileProperty() == null) {
      String regex = tbrp.fileNamePattern.toRegex(dateInCurrentPeriod);
      String stemRegex = FileFilterUtil.afterLastSlash(regex);
      // beginning of changes
      boolean fileExists = computeCurrentPeriodsHighestCounterValue(stemRegex);
      if (fileExists && newFileOnStart)

      { currentPeriodsCounter++; }

      // end of changes
      }

      Attachments

        Activity

          Loading...
          We are migrating this Jira service to Github. Issue creation is no longer possible on this server and must be done on Github. However, you may browse issues without an account. Editing or commenting on existing issues requires an account.

          Please support SLF4J/logback/reload4j projects via Github donations and sponsorship.

          Uploaded image for project: 'logback'
          1. logback
          2. LOGBACK-248

          option to create new file on start of SizeAndTimeBasedFNATP

          Details

            • Icon: Improvement Improvement
            • Resolution: Unresolved
            • Icon: Minor Minor
            • None
            • None
            • logback-core
            • None

            Description

              It would be nice to have the option of having the SizeAndTimeBasedFNATP always create a new file on a restart (only applicable when <File> is not specified – only the <FileNamePattern>). Currently, if a process locks the latest file while the appender is stopped, then the FileAppender.openFile will fail if the file is still locked when the appender starts again.

              I'm currently accomplishing this by overriding SizeAndTimeBasedFNATP.start and using reflection to increment the currentPeriodsCounter.

              If a boolean option (e.g. "newFileOnStart") was added to SizeAndTimeBasedFNATP and computeCurrentPeriodsHighestCounterValue was modified to return whether or not a matching file was found, then the start method could be modified as shown below:

              if (tbrp.getParentsRawFileProperty() == null) {
              String regex = tbrp.fileNamePattern.toRegex(dateInCurrentPeriod);
              String stemRegex = FileFilterUtil.afterLastSlash(regex);
              // beginning of changes
              boolean fileExists = computeCurrentPeriodsHighestCounterValue(stemRegex);
              if (fileExists && newFileOnStart)

              { currentPeriodsCounter++; }

              // end of changes
              }

              Attachments

                Activity

                  People

                    logback-dev Logback dev list
                    rcogswell Ryan Cogswell
                    Votes:
                    0 Vote for this issue
                    Watchers:
                    2 Start watching this issue

                    Dates

                      Created:
                      Updated:

                      People

                        logback-dev Logback dev list
                        rcogswell Ryan Cogswell
                        Votes:
                        0 Vote for this issue
                        Watchers:
                        2 Start watching this issue

                        Dates

                          Created:
                          Updated: