Hello Jesse!
As per my knowledge, the following flags are important for log rotation:
-Xloggc:gc.log -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:GCLogFileSize=10m -XX:NumberOfGCLogFiles=10
- XX:+PrintGCDateStamps - This flag is not needed but if you use it, it will help you to analyze the events in the log file because it prefixes lines with human readable timestamp.
- -XX:-UseGCLogFileRotation - This flag is used to enable log rotation.
- -XX:GCLogFileSize - This flag is used to define your log file size. The default value is 512k. In the above example, I used 10MB. After 10MB log will be rotated. You should avoid very high values that will cause memory issues.
- -XX:NumberOfGCLogFiles - This flag is used to define the number of files you want to use in log rotating. You are free to keep more files unless you wish to keep data for later analysis.
Edit your Comment