You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/06/02 20:21:00 UTC

[jira] [Work logged] (LOG4NET-620) RollingFileAppender extension that backs up only a last specified period (days, hours, etc.) proposal

     [ https://issues.apache.org/jira/browse/LOG4NET-620?focusedWorklogId=252857&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-252857 ]

ASF GitHub Bot logged work on LOG4NET-620:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Jun/19 20:20
            Start Date: 02/Jun/19 20:20
    Worklog Time Spent: 10m 
      Work Description: fnasimbd commented on pull request #50: Fixes LOG4NET-620 RollingFileAppender extension that backs up only a last specified period (days, hours, etc.) proposal
URL: https://github.com/apache/logging-log4net/pull/50
 
 
   This pull request attempts implementing the feature requested in [LOG4NET-620](https://issues.apache.org/jira/browse/LOG4NET-620).
   
   A new `RollingFileAppender` derivative `RollingFileAppenderTrailing` implements the feature. Still incomplete though, here follows roughly how it works, with requests for suggestions and opinions at places.
   
   1. The new `RollingFileAppenderTrailing` preserves only logs trailing the current timestamp by a user specified `TrailPeriod` (new public property, set by user in configuration, name suggestions are welcome :) .) I know log4net community prefers _composition over subclasses_; still, however, I am putting the current subclass for consideration.
   2. `TrailPeriod`. The tailing period of logs to be preserved, specified as a string representation of a standard .NET `TimeSpan`. Any better idea for format is welcome.
   3. On startup (`ActivateOptions`) and on the first log event every _trail period_ since startup, all outdated log files, based on the file's last write time, are cleaned up. I made this choice ostensibly as an optimization measure: checking for cleanup on each log event degrades performance. This choice certainly has an implication: outdated log files may accumulate in cases where multiple files are created in a trail period (e.g. hourly `DatePattern` for a `TrailPeriod` greater than a day.) Expecting opinions on this.
   4. Log files are deleted only if they are _absolutely_ outside the trail period; files with entries _straddling_ the `TrailPeriod` are preserved.
   5. The test class `RollingFileAppenderTrailingTest` extends `RollingFileAppenderTest`. In order to make all the base tests available to the derivative, I have made the logger factory methods (`CreateLogger`) virtual-instance methods instead of private-static ones.
   6. I am coming up with more tests. Some tests may run for over a minute; is there any restriction on individual test execution time?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 252857)
            Time Spent: 10m
    Remaining Estimate: 0h

> RollingFileAppender extension that backs up only a last specified period (days, hours, etc.) proposal
> -----------------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-620
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-620
>             Project: Log4net
>          Issue Type: Wish
>          Components: Appenders
>            Reporter: Farhan Nasim
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> A scenario occurs in many business cases where log files covering only a last specified period is needed (e.g. last 5 days, last 3 hours, etc.) Log4net doesn't provide any such appender; couldn't find any standard implementation either. I am writing one such appender (made some progress in fact) that derives from _RollingFileAppender_ and follows Log4net conventions.
>  # Is Log4net considering this or any similar appenders?
>  # I need some critical feedbacks (e.g. naming, conventions, etc.) at this stage. Am I supposed to submit my changes as a pull request or have them discussed here?
>  # Is there any coding convention guide for contributors?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)