You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2015/10/18 16:37:05 UTC

[jira] [Resolved] (LOG4J2-1109) Archiving doesn't work

     [ https://issues.apache.org/jira/browse/LOG4J2-1109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma resolved LOG4J2-1109.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.4.1

Fixed in 2.4.1 (see also LOG4J2-1135, sorry I did not notice your Jira ticket earlier).

Please verify and close.

> Archiving doesn't work
> ----------------------
>
>                 Key: LOG4J2-1109
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1109
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.4
>         Environment: CentOS6.5
>            Reporter: Alex Krasov
>             Fix For: 2.4.1
>
>
> Archiving doesn't work with DefaultRolloverStrategy as expected, the file (ending with either .zip or .gz) is being created with appropriate (zip, bz) extension but it's actually unzipped.
> The reason is that the ZipCompressAction expects the original file (to be compressed and deleted) without the zip extension, but the renaming action just renames it to the full name - with zip extension.
> I've fixed this issue for me (at DefaultRolloverStrategy .java) by replacing the 
>  final FileRenameAction renameAction =
>             new FileRenameAction(new File(currentFileName), new File(renameTo), false);
> with
> //Remove the archive suffix from renameTo (created before archiving)
> 		String renameToBeforeCompress = compressAction==null?renameTo:renameTo.substring(0, renameTo.lastIndexOf('.'));
> 		
>         final FileRenameAction renameAction =
>             new FileRenameAction(new File(currentFileName), new File(renameToBeforeCompress), false);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org