I would like to rotate logs that are already being managed by logrotate.
However logrotate used to rotate log only on daily basis as it is purely a CRON task.
I would like to execute logrotate when ever the file size exceeds the size specified in the size parameter for logrotate config file. I am planning to implement the same by monitoring the log files and execute the logrotate when ever the size of the log file exceeds the size specified in logrotate config.
What is the optimal way to do this in java?