Please refer below links, it will help you how you to configure logging in CQ as per above requirement
Let me know if you need more info.
Thanks for the links Rush.
I've already had a look through them, but I took another quick look just to confim something. Regarding rotating the logs, the docs state:
org.apache.sling.commons.log.file.size controls the rotation of the log file by setting either:
- a maximum file size
- a time/date schedule
to indicate when a new file will be created (and the existing file renamed according to the name pattern).
So based on this, if I set the 'Number of Log Files' to 14 and set the 'Log File Threshold' to 200MB for my error.log, I'll get up to 14 error.log.n files and then the files will rotate at 200MB up to 14 times. If I set set the 'Number of Log Files' to 14 and set the 'Log File Threshold' to '.'yyyy-MM-dd, I'll get 1 error.log..yyyy-MM-dd file per day, but the Number of Log Files is ignored. Unless I manually intervene, these log files will never be removed from the system and continue to eat disk space.
What I'm hoping for is that CQ5 can be configured in any way to have a blend of the two types - 'Number of Log Files' is14 and the 'Log File Threshold' is '.'yyyy-MM-dd, which would mean that the log files are rotated each day, but are purged by CQ5 after 14 days.
From my understanding of the docs this is not possible regarding this general log writer configuration, but is there another way in CQ5 to achieve this?