Add Chocolatey log retention settings to Chocolatey Config
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
### Checklist
- [X] I have verified this is the correct repository for opening this issue.
- [X] I have verified no other issues exist related to my request.
### Is Your Feature Request Related To A Problem? Please describe.
A couple customers over the years have inquired about being able to set custom log retention for Chocolatey. I know we hard node a Log4Net config for Chocolatey to keep up to 50 chocolatey logs that can be up to 10MB in size currently in Chocolatey V 2.0 Instead of writing custom Log4Net.config files that need to contain a lot more then just the retention appenders for Chocolatey to log as it currently does. I think having these as configs setting within the Chocolatey config would be ideal.
### Describe The Solution. Why is it needed?
A few customers have asked for this. Mainly trying to further control the logging. A long lived system having 50 chocolatey logs isn't ideal. We should have configurable log retention without needing a thorough understanding of .Net logging to do so.
### Additional Context
We need to be careful about what settings we add to Chocolatey config, as it may get so complex that simply using a Log4Net config file may be simpler for everybody.
Adding the number of logs and their size to the Chocolatey config makes sense, but we should be clear that additional functionality should be added directly to the Log4Net config as an additional appender.
We also need to be aware that we have to ensure the default chocolatey.log file has to be created in the format it is in, for support purposes.
### Related Issues
- [ZenDesk Ticket](https://chocolatey.zendesk.com/agent/tickets/18075)
Contributor guide
Research direction
Review how Chocolatey Config settings are defined and how the current Log4Net.config handling creates chocolatey.log. Determine where configurable log count and size would belong while preserving the existing chocolatey.log format and leaving additional appender functionality in Log4Net configuration. Done means the scope and configuration behavior are defined without requiring custom Log4Net.config files for retention.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100