[ 
https://issues.apache.org/jira/browse/LOG4J2-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16062637#comment-16062637
 ] 

ASF GitHub Bot commented on LOG4J2-1766:
----------------------------------------

GitHub user phymbert opened a pull request:

    https://github.com/apache/logging-log4j2/pull/88

    [LOG4J2-1766] Temporary compress directory during rollover

    commit a135e42cbafcaee88a015af80e4f411d688934e5
    Merge: 5fe81f4 d66b640
    Author: phymbert <[email protected]>
    Date:   Mon Jun 26 10:48:52 2017 +0300
    
        Merge branch 'LOG4J2-1766' of github.com:phymbert/logging-log4j2 into 
LOG4J2-1766
    
    commit 5fe81f452741ccedadbab85e57982676b7d3f109
    Author: phymbert <[email protected]>
    Date:   Sat Jun 24 19:27:28 2017 +0300
    
        [LOG4J2-1766] Fix javadoc, little switch min/max
    
    commit d74ff872bfb0824969d277fbbe5409918cc90840
    Author: phymbert <[email protected]>
    Date:   Sat Jun 24 14:23:24 2017 +0300
    
        [LOG4J2-1766] Introduce builder API in DefaultRolloverStrategy and
        DirectWriteRolloverStrategy. Add test and documentation for
        DirectWriteRolloverStrategy
        and tmp compress directory.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit d267ff72b68e6a412931ff97baa2d9eb2dc29e8a
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:54:58 2017 +0300
    
        [LOG4J2-1766] Little formating.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit 8a5f863e3860d2985113d0e9c61153dfad6a12c1
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:50:24 2017 +0300
    
        [LOG4J2-1766] Documentation of compressTmpFilePattern
        DefaultRolloverStrategy parameter.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit cbc36b77d09309b832afa6236c2d44cf4a5bbe80
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:49:43 2017 +0300
    
        [LOG4J2-1766] Rebase onto master from original jira patch.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit d66b640fb302d31618c3d253a89ba051b3067965
    Author: phymbert <[email protected]>
    Date:   Sat Jun 24 19:27:28 2017 +0300
    
        [LOG4J2-1766] Fix javadoc, little switch min/max
    
    commit ba01986addcbc9d75f1b2a07319878e177a78a9f
    Author: phymbert <[email protected]>
    Date:   Sat Jun 24 14:23:24 2017 +0300
    
        [LOG4J2-1766] Introduce builder API in DefaultRolloverStrategy and
        DirectWriteRolloverStrategy. Add test and documentation for
        DirectWriteRolloverStrategy
        and tmp compress directory.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit e583d1ef653569fd97b57a5d156a370396e1116f
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:54:58 2017 +0300
    
        [LOG4J2-1766] Little formating.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit 33d3cf58b7c5da790170469e6e77e0680c49b934
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:50:24 2017 +0300
    
        [LOG4J2-1766] Documentation of compressTmpFilePattern
        DefaultRolloverStrategy parameter.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit af4d3ddd18babe29f3983f83631b36d987cd022c
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:49:43 2017 +0300
    
        [LOG4J2-1766] Rebase onto master from original jira patch.
    
        Signed-off-by: phymbert <[email protected]>

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/phymbert/logging-log4j2 LOG4J2-1766

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/logging-log4j2/pull/88.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #88
    
----
commit 576147961529c7cfdd23d76aa14dc3767e0671d8
Author: phymbert <[email protected]>
Date:   2017-06-26T07:54:40Z

    Squashed commit of the following:
    
    commit a135e42cbafcaee88a015af80e4f411d688934e5
    Merge: 5fe81f4 d66b640
    Author: phymbert <[email protected]>
    Date:   Mon Jun 26 10:48:52 2017 +0300
    
        Merge branch 'LOG4J2-1766' of github.com:phymbert/logging-log4j2 into 
LOG4J2-1766
    
    commit 5fe81f452741ccedadbab85e57982676b7d3f109
    Author: phymbert <[email protected]>
    Date:   Sat Jun 24 19:27:28 2017 +0300
    
        [LOG4J2-1766] Fix javadoc, little switch min/max
    
    commit d74ff872bfb0824969d277fbbe5409918cc90840
    Author: phymbert <[email protected]>
    Date:   Sat Jun 24 14:23:24 2017 +0300
    
        [LOG4J2-1766] Introduce builder API in DefaultRolloverStrategy and
        DirectWriteRolloverStrategy. Add test and documentation for
        DirectWriteRolloverStrategy
        and tmp compress directory.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit d267ff72b68e6a412931ff97baa2d9eb2dc29e8a
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:54:58 2017 +0300
    
        [LOG4J2-1766] Little formating.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit 8a5f863e3860d2985113d0e9c61153dfad6a12c1
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:50:24 2017 +0300
    
        [LOG4J2-1766] Documentation of compressTmpFilePattern
        DefaultRolloverStrategy parameter.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit cbc36b77d09309b832afa6236c2d44cf4a5bbe80
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:49:43 2017 +0300
    
        [LOG4J2-1766] Rebase onto master from original jira patch.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit d66b640fb302d31618c3d253a89ba051b3067965
    Author: phymbert <[email protected]>
    Date:   Sat Jun 24 19:27:28 2017 +0300
    
        [LOG4J2-1766] Fix javadoc, little switch min/max
    
    commit ba01986addcbc9d75f1b2a07319878e177a78a9f
    Author: phymbert <[email protected]>
    Date:   Sat Jun 24 14:23:24 2017 +0300
    
        [LOG4J2-1766] Introduce builder API in DefaultRolloverStrategy and
        DirectWriteRolloverStrategy. Add test and documentation for
        DirectWriteRolloverStrategy
        and tmp compress directory.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit e583d1ef653569fd97b57a5d156a370396e1116f
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:54:58 2017 +0300
    
        [LOG4J2-1766] Little formating.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit 33d3cf58b7c5da790170469e6e77e0680c49b934
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:50:24 2017 +0300
    
        [LOG4J2-1766] Documentation of compressTmpFilePattern
        DefaultRolloverStrategy parameter.
    
        Signed-off-by: phymbert <[email protected]>
    
    commit af4d3ddd18babe29f3983f83631b36d987cd022c
    Author: phymbert <[email protected]>
    Date:   Fri Jun 23 14:49:43 2017 +0300
    
        [LOG4J2-1766] Rebase onto master from original jira patch.
    
        Signed-off-by: phymbert <[email protected]>

----


> Distinguish between partial and completed .gz archive file
> ----------------------------------------------------------
>
>                 Key: LOG4J2-1766
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1766
>             Project: Log4j 2
>          Issue Type: New Feature
>    Affects Versions: 2.5
>            Reporter: Sameer Pradhan
>              Labels: features
>
> I have the following log configuration.
>     <RollingRandomAccessFile name="RollingReqAppender"
>         fileName="/usr/test/req.log"
>         filePattern="/usr/test/req.log.%d{yyyy-MM-dd-HH}.%i.gz"
>         immediateFlush="true" append="true">
>         <PatternLayout>
>             <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS Z}%m%n</Pattern>
>         </PatternLayout>
>         <Policies>
>             <SizeBasedTriggeringPolicy size="500 MB"/>
>             <TimeBasedTriggeringPolicy interval="1" modulate="true" />
>         </Policies>
>     </RollingRandomAccessFile>
> When the log is rolled over (based on time or size), it is gzipped. Gzipping 
> the file takes some time (seconds to minutes depending on load). The problem 
> is that the file is gzipped in place, and while it is being gzipped, the 
> partially gzipped file is stored in the same folder with the same name as the 
> final gzip file. e.g.: /usr/test/req.log.2017-01-03-02.1.gz
> This causes problems for the file's consumer, which attempts to process the 
> partial file. I want to be able to distinguish between a partial gzipped file 
> and a completed gzipped file. For example, I would like to setup a 
> configuration that while the file is being gzipped, it is written with a 
> different name e.g.: /usr/test/req.log.2017-01-03-02.1.gz.temp and once it is 
> completely gzipped the name is changed to the final name 
> /usr/test/req.log.2017-01-03-02.1.gz
> One way to achieve this is to add a new parameter like 
> "temporaryCompressedFilePattern" as follows:
> <RollingRandomAccessFile name="RollingReqAppender"
>         fileName="/usr/test/req.log"
>         filePattern="/usr/test/req.log.%d{yyyy-MM-dd-HH}.%i.gz"
>         
> temporaryCompressedFilePattern="/usr/test/req.log.%d{yyyy-MM-dd-HH}.%i.gz.temp"
> Another option is to make such behavior the default behavior without adding a 
> new parameter.
>  
> This was first discussed at 
> http://stackoverflow.com/questions/41457492/partial-gz-file-written-by-log4j2
> Creating this feature request as suggested by @rpopma



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to