Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-1719

(7.0.z) Log rotation fails on Windows if target already exists


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.8.CR1, 7.0.8.GA
    • None
    • Logging
    • None
    • EAP 7.0.8

      PeriodicRotatingFileHandler (and others) use File.renameTo() to rename the file. That method is documented as having many implementation-defined aspects, see http://docs.oracle.com/javase/7/docs/api/java/io/File.html#renameTo%28java.io.File%29

      One that can be a problem is that on Windows, it will fail if the target file already exists. If you use a ".dd" suffix, this will occur when it rolls over to a new month. It has rarely been a problem, since most people use the year month and day so they are unique. Files.move() can replace existing files, so may be better, and some of the costs of that are likely not to be a problem with how it is using here.

            jperkins-rhn James Perkins
            psotirop@redhat.com Panagiotis Sotiropoulos
            Jiří Bílek Jiří Bílek (Inactive)
            Jiří Bílek Jiří Bílek (Inactive)
            0 Vote for this issue
            3 Start watching this issue