Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9
    • Labels:
      None
    • Environment:
      Any time Velocity spits over 100KB of log
    • Number of attachments :
      2

      Description

      Currently, clean:clean only cleans velocity.log, and not velocity.log.1.

      By default, Velocity uses the RollingFileAppender with maxBackupIndex=1 and maximumFileSize=100000. Which means, if the log file exceeds 100000 bytes, the log file will be rolled to velocity.log.1 and a new log file will start. If the clean plugin is going to clean the original log, it should also clean the rolled log.

      (Or, I guess it could be put in the xdoc plugin.)

      1. clean.patch
        0.6 kB
        Shinobu Kawai
      2. xdoc-clean.patch
        2 kB
        Shinobu Kawai

        Issue Links

          Activity

          Hide
          Shinobu Kawai added a comment -

          A patch to let clean:clean clean the rolled log file as well

          Show
          Shinobu Kawai added a comment - A patch to let clean:clean clean the rolled log file as well
          Hide
          David Eric Pugh added a comment -

          While your patch would work for velocity.log.1, it won't work for velocity.log.2 or name your extra artifact.

          If you are interested, look at how other plugins implement includes and excludes patterns. PMD and JCoverage would be examples.

          What you really want are a list of maven.clean.include patterns that you would specify:

          maven.clean.include=.log.,myOtherLog.log

          Eric

          Show
          David Eric Pugh added a comment - While your patch would work for velocity.log.1, it won't work for velocity.log.2 or name your extra artifact. If you are interested, look at how other plugins implement includes and excludes patterns. PMD and JCoverage would be examples. What you really want are a list of maven.clean.include patterns that you would specify: maven.clean.include= .log. ,myOtherLog.log Eric
          Hide
          Shinobu Kawai added a comment -

          Don't worry, Velocity will only roll one file, so the patch is sufficient in Velocity's case. B)

          I read Brett's comment in http://jira.codehaus.org/browse/MPCLEAN-2, and it made me think, "If they want the torque plugin to clean up its mess, why is the clean plugin so generous as to clean up Velocity's mess?". If Velocity is so special, I guessed the patch could be Velocity-specific. (The velocity.log was there from the date of birth.)

          Show
          Shinobu Kawai added a comment - Don't worry, Velocity will only roll one file, so the patch is sufficient in Velocity's case. B) I read Brett's comment in http://jira.codehaus.org/browse/MPCLEAN-2 , and it made me think, "If they want the torque plugin to clean up its mess, why is the clean plugin so generous as to clean up Velocity's mess?". If Velocity is so special, I guessed the patch could be Velocity-specific. (The velocity.log was there from the date of birth.)
          Hide
          David Eric Pugh added a comment -

          Brett does have a valid point. And his point is why I want to supply a generic maven.clean.includes patternset, versus a hardcoded velocity.log.1 file.

          I agree, the fix you supplied should be in the xdoc plugin, it's specific to the logic of the xdoc plugin.

          As an alternative, b/c we know that artifacts are created randomly, a pattern would be a solution.

          I currenlty have tons of:
          <postGoal name="clean">
          <logic to delete tomcat logs and other werid stuff/>
          </postGoal>

          That could be replaced by the maven.clean.includes patternset.

          Show
          David Eric Pugh added a comment - Brett does have a valid point. And his point is why I want to supply a generic maven.clean.includes patternset, versus a hardcoded velocity.log.1 file. I agree, the fix you supplied should be in the xdoc plugin, it's specific to the logic of the xdoc plugin. As an alternative, b/c we know that artifacts are created randomly, a pattern would be a solution. I currenlty have tons of: <postGoal name="clean"> <logic to delete tomcat logs and other werid stuff/> </postGoal> That could be replaced by the maven.clean.includes patternset.
          Hide
          Shinobu Kawai added a comment -

          Okay, here's the patch to move the Velocity log cleaning to the xdoc plugin. As for the maven.clean.include extension, I think a new issue should be filed.

          Show
          Shinobu Kawai added a comment - Okay, here's the patch to move the Velocity log cleaning to the xdoc plugin. As for the maven.clean.include extension, I think a new issue should be filed.
          Hide
          David Eric Pugh added a comment -

          Fixed with a postgoal on clean:clean.

          Show
          David Eric Pugh added a comment - Fixed with a postgoal on clean:clean.

            People

            • Assignee:
              David Eric Pugh
              Reporter:
              Shinobu Kawai
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: