You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ferenc HORVÁTH (Jira)" <ji...@apache.org> on 2019/09/27 21:05:00 UTC

[jira] [Commented] (LOG4NET-579) RollingFileAppender - file compression feature

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

Ferenc HORVÁTH commented on LOG4NET-579:
----------------------------------------

Hi Dominik,

Sorry for the late response, but after two years I realized that I did not write anything to this topic. So generally I think I will not have enough time to do this work at the moment.

But I needed this feature, so I had to implement it for the current version. If you think it would be useful for the project, I can offer it for the community. It is very simple: I made the {{RollFile}} method of the {{RollingFileAppender}} _virtual_, and made a child class for it called {{CompressorRollingFileAppender}}, and its' {{RollFile}} method contains a _gzip_ compression (it was the most simple to implement) after rolling. I'm using it for two years without any problems/errors and - because I usually do the logging on a verbose way - I could not live without this feature.

Just let me know if you need it. I hope in the near future I will have some time to contribute to the development of the NG version.

Kind regards

> RollingFileAppender - file compression feature
> ----------------------------------------------
>
>                 Key: LOG4NET-579
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-579
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Appenders
>            Reporter: Ferenc HORVÁTH
>            Priority: Major
>
> Hi Guys,
> I used _log4j_ in the past, and its {{RollingFileAppender}} has the possibility to compress the rolled file. It would be a nice feature in _log4net_ too, because it is much easier to handle the rolled files in compressed format. After a lot of searching I did not find a built-in solution in _log4net_ for compression, I decided to implement it. I wanted to do it using the {{RollFile}} method, but I was not able to do it, because the {{RollFile}} method is not _virtual_ this time. So the solution was for me: I copied the {{RollingFileAppender}} into a custom namespace, made its {{RollFile}} _virtual_, and wrote a subclass which had a customized {{RollFile}} method. At least a _virtual_ {{RollFile}} method would be useful too.
> Thanks:
> Ferenc



--
This message was sent by Atlassian Jira
(v8.3.4#803005)