FrankChen021 opened a new pull request #10147:
URL: https://github.com/apache/druid/pull/10147


   
   This PR fixes #10127 
   
   ### Description
   
   Druid outputs logs to log files through redirection of standard console 
output, in which way after a long time running, the log files can be very 
large, up to tens or hundreds of GB in size.  This introduces extra work for 
users to clean or roll those log files to save disk space.
   
   Since log4j2 is used by Druid to record logs, it's better to take advantage 
of log4j2's file appender to save log in files directly and roll log files as a 
default way. 
   
   This PR
   1.  fixes the startup scripts to pass down two variables as system 
properties to Druid process so that log4j.xml knows where to save log files and 
how to name the log files
   2. replaces the console appender in the default log4j2.xml configuration 
files with `RollingRandomAccessFile` to roll log files and remove expired log 
files
   
   With the these changes , we also provide an easy way for user
   1.  to config (through environment variable) where to save the log files 
   2.  to change how long they want to keep log files (in log4j2.xml)
   
   <hr>
   
   This PR has:
   - [X] been self-reviewed.
   - [X] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/licenses.yaml)
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] added integration tests.
   - [X] been tested in a test Druid cluster.
   


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to