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

Grant Henke commented on KUDU-3279:
-----------------------------------

I looked into implementing this, but it turns out it's already been done in 
Kudu 1.7.0+ via KUDU-2279 here:
https://github.com/apache/kudu/commit/3e49fe2f7ca9afa603da600872cf3649346a0c22

It looks like the diagnostic log is implemented using a `RollingLog`: 
https://github.com/apache/kudu/blob/master/src/kudu/server/diagnostics_log.cc#L139

The RollingLog respects `--max_log_files`: 
https://github.com/apache/kudu/blob/master/src/kudu/util/rolling_log.cc#L63

This functionality is ensure via RollingLogTest.TestFileCountLimit:
https://github.com/apache/kudu/blob/master/src/kudu/util/rolling_log-test.cc#L133

It looks like this cleanup in done when closing the log which is called in the 
destructor and when rolling a new file due to `roll_threshold_bytes_`:
https://github.com/apache/kudu/blob/master/src/kudu/util/rolling_log.cc#L184


> Limit the number of diagnostic files kept
> -----------------------------------------
>
>                 Key: KUDU-3279
>                 URL: https://issues.apache.org/jira/browse/KUDU-3279
>             Project: Kudu
>          Issue Type: Improvement
>          Components: log
>            Reporter: Alexey Serbin
>            Priority: Major
>
> When enabled, {{kudu-master}} and {{kudu-tserver}} processes generate 
> diagnostics files in the log directory along with INFO/WARNING/ERROR/FATAL 
> log files.  To prevent issues running out of logging space, it would be nice 
> if a user could configure the maximum number of diagnostics files to keep.  
> Older diagnostics files should be removed if there are too many of those 
> stored already.



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

Reply via email to