WSO2 uses log4j which is a standard logging for Java but using it in a plain way may not give the best result.
1- configure log4j to support the format that you need
2- set up a java code to collect the archived files and compress them
3- set up a cron or jenkins job to move and clear your files
4- set the frequency for your cron to be relevant to your traffic